In previous versions of FC, one could change the clock speed. Not V7. The reason I want to do this is that I use Timer1 and overflow interrupt to
have a minute variable be relatively accurate during a day, for a solar tracking application. I use a real time clock to update the time daily, to be dead on.
By using a clock speed of 15,999,522 HZ , the minutes are close to accurate over a 24 hour period. I have included the program. Is there way to change the clock speed. It is hard coded to 16 mega Hz.
Hardware:UNO R3 PDIP
Clock Speed
Moderator: Benj
-
- Posts: 162
- Joined: Thu Jul 01, 2010 1:57 am
- Has thanked: 23 times
- Been thanked: 16 times
- Contact:
Re: Clock Speed
I note that when the target chip is changed to the ATMEGA 328P, which is what the UNO uses, (instead of the UNO R3 PDIP) , then you can change the clock speed.
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
Re: Clock Speed
Clock speeds are fixed for hardware with fixed crystal oscillators like the arduino boards.billduck wrote:Hardware:UNO R3 PDIP
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Posts: 162
- Joined: Thu Jul 01, 2010 1:57 am
- Has thanked: 23 times
- Been thanked: 16 times
- Contact:
Re: Clock Speed
I was able to key in a value in previous versoins of FC. I assume I accomplished what I intended.
Seems logical though. I am assuming that since I can change the clock speed when I use ATMEGA328P, that this is incorrect also.
Seems logical though. I am assuming that since I can change the clock speed when I use ATMEGA328P, that this is incorrect also.
- 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: Clock Speed
Hi billduck,
For the Arduino devices we lock the clock speed as most users won't ever want to change it.
You can override the clock speed yourself by going into the "Flowcode 7\FCD\AVR" directory
Copy the file "Arduino Uno R3 PDIP.fcdx" to your desktop.
Open the file on your desktop using a text editor such as notepad.
Right near the top of the file is this section.
Change the fixed value to match the clock speed setting you require.
For example:
Save the file and copy back in to the "Flowcode 7\FCD\AVR" directory
For the Arduino devices we lock the clock speed as most users won't ever want to change it.
You can override the clock speed yourself by going into the "Flowcode 7\FCD\AVR" directory
Copy the file "Arduino Uno R3 PDIP.fcdx" to your desktop.
Open the file on your desktop using a text editor such as notepad.
Right near the top of the file is this section.
Code: Select all
<clock max_speed="16000000"
master_divider="1"
fixed="16000000" />
For example:
Code: Select all
fixed="15999522"
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel