Page 1 of 1

12F1840 Running extremely slow

Posted: Thu Aug 25, 2016 3:06 pm
by SHORTCIRCUIT
Hi

I have been struggling with getting the 12F1840 to run properly with not much success.

I'm using osccon=0x70; for 8mhz. Simple test program to flash LED on A0 at 1 second rate which results in over a 1 minute rate.
I have set the general options under Build to 32000hz and program seems to run at a speed somewhat close to the 1 second.
I have included my Flowcode6 file so you can understand what I am doing wrong. Any help would certainly be appreciated.

Larry
12F1840 TEST.fcfx
(4.58 KiB) Downloaded 364 times

Re: 12F1840 Running extremely slow

Posted: Thu Aug 25, 2016 3:25 pm
by medelec35
Hi Larry,
Just a simple typo.
You have got

Code: Select all

osccon=0x07;
Instead of

Code: Select all

osccon=0x70;
Which means your chip is running at 31KHz instead of 8MHz

Martin

Re: 12F1840 Running extremely slow

Posted: Thu Aug 25, 2016 7:59 pm
by SHORTCIRCUIT
Hi Martin

As usual, are are awesome. I feel so stupid. I even checked my other programs and did not catch the typo.
I guarantee you that will never happen again. Thank you so much.

Larry

Re: 12F1840 Running extremely slow

Posted: Thu Aug 25, 2016 10:15 pm
by medelec35
Hi Larry not a problem at all.
These things can catch us all out, no matter how experenced we are.

Martin