Page 1 of 1
PIC12f1840 speed selection
Posted: Tue Sep 02, 2025 4:00 pm
by alanwms
Flowcode version 9.
Running a short program at project option speed 32 (mhz). Delay times are double expected time. I changed to project option time to 20 mhz and the delay times are correct.
FYI
Re: PIC12f1840 speed selection
Posted: Tue Sep 02, 2025 4:33 pm
by medelec35
Hi.
Sounds like you have not set up the internal oscillator correctly.
Take a look at the
Wiki.
Re: PIC12f1840 speed selection
Posted: Wed Sep 10, 2025 3:01 pm
by alanwms
If the system timing is correct at 20mhz, would that not indicate internal oscillator to be correct?
Re: PIC12f1840 speed selection
Posted: Wed Sep 10, 2025 3:52 pm
by chipfryer27
Hi
If you mean where you can select clock speed under project options (highlighted yellow) then that only tells Flowcode what speed you are running at, not the hardware. You still need to select that (highlighted green) and possibly add in a C-code block.

- Screenshot 2025-09-10 154934.jpg (103.25 KiB) Viewed 2404 times
If you post your chart we can look further.
Regards
Re: PIC12f1840 speed selection
Posted: Thu Sep 11, 2025 7:16 pm
by alanwms
Thank you. I think I have selected the correct register number for the osc? Maybe not? I have attached my file
Re: PIC12f1840 speed selection
Posted: Thu Sep 11, 2025 7:48 pm
by chipfryer27
Hi
Have a look at the attached snippet from Datasheet. It illustrates the available options you can select using the internal oscillator. If you choose one of them then you should be good. 20MHz would only be an option if using an external crystal.
Flowcode has the Internal Oscillator Helper under Runtime, and this will tell you the code to use in your C-block for your chosen IntOsc, and of course don't forget to set your clock speed to match, under "Other Options" as this tells FC what frequency you are running.

- Screenshot 2025-09-11 194148.jpg (61.73 KiB) Viewed 2383 times
Regards