17 second delay on startup

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
User avatar
robertpatterson
Posts: 44
Joined: Thu Feb 21, 2013 2:16 am
Location: New England
Been thanked: 6 times

17 second delay on startup

Post by robertpatterson »

My pic 12f1840 has a delay of 17 seconds on startup I can't figure out why this is happening When it runs everything is
running correctly. Its like the old days waiting for the tubes to warm up. :shock: I hope Microchip is not going back to tube technology. :lol:

----------------------------------------
Delay:

300 ms
----------------------------------------

----------------------------------------
C Code:

osccon=0x70;//Inter osc 8 Or 32 MHz
//For 8MHz disable PLL
//For 32MHz enable PLL
----------------------------------------

----------------------------------------
Comment:

rs232 @38.4 kb
----------------------------------------

----------------------------------------
Call Component Macro:


----------------------------------------

----------------------------------------
Calculation:

BIT_COUNT = 0
----------------------------------------

----------------------------------------
Connection PointConnection Point: [A]: A
----------------------------------------

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 17 second delay on startup

Post by Benj »

Hello,

The delay before you enable the PLL will be massive because the device is running at a much lower clock speed then assigned in the project options e.g. 8MHz / 32MHz vs default 500KHz. Try reducing the startup delay and you should get a delay more like what your expecting.

With Project options clock set to 32MHz, 4ms will give you around 300ms when running at 500KHz.

With Project options clock set to 8MHz, 18ms will give you around 300ms when running at 500KHz.

User avatar
robertpatterson
Posts: 44
Joined: Thu Feb 21, 2013 2:16 am
Location: New England
Been thanked: 6 times

Re: 17 second delay on startup

Post by robertpatterson »

Thanks Ben you saved the day again.

User avatar
robertpatterson
Posts: 44
Joined: Thu Feb 21, 2013 2:16 am
Location: New England
Been thanked: 6 times

Re: 17 second delay on startup

Post by robertpatterson »

I moved the delay command below the osccon command and that corrected it. (fast boots now)

Post Reply