Page 1 of 1

17 second delay on startup

Posted: Wed Jul 16, 2014 1:29 pm
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
----------------------------------------

Re: 17 second delay on startup

Posted: Wed Jul 16, 2014 3:29 pm
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.

Re: 17 second delay on startup

Posted: Wed Jul 16, 2014 3:50 pm
by robertpatterson
Thanks Ben you saved the day again.

Re: 17 second delay on startup

Posted: Wed Jul 16, 2014 4:37 pm
by robertpatterson
I moved the delay command below the osccon command and that corrected it. (fast boots now)