Page 1 of 1

Internal oscillator configuration

Posted: Sat Jun 28, 2014 3:57 pm
by alaahima
I have an atmega32 , Its default frequency is 1 MHz , I created a simple flasher program , I configured the chip to run at 8 MHz from project settings , Thus I changed the clock speed from project options also to 8000000 Hz(8MHz) ... When I ran the hardware the delays were almost 10 times longer than they should.
What went wrong? , and can Flowcode change the default internal oscillator frequency? , and how does this affect delays and/or PWM? ... And if possible I would appreciate a 1 hz test flasher program configuring the chip to 8 MHz (internal).
Thanks in advance ... Cheers

Re: Internal oscillator configuration

Posted: Mon Jun 30, 2014 9:58 am
by Benj
Hello,

With a PIC the config data is embedded into the hex file and sent at the same time as programming. For AVR the config is loaded separate from the hex file containing the program. When you go to the project options and select configure you select your setting and then press ok. A small dialogue box should then pop up with the textual settings for the device config. Pressing the OK and Send button should allow the values to be transferred to the device.

Flowcode calculates delays based on the clock speed in the project options so for a 1s delay at 8MHz you essentially need a counter loaded with 8million and when this has counted down to 0 you know 1 second has passed. If instead your device is running at the default 1MHz then the delay will be miscalculated and take 8 times longer than it should.

Re: Internal oscillator configuration

Posted: Sat Jul 05, 2014 2:17 am
by alaahima
Thanks for replying Benj... I seem to have a problem with the "ok & send" to the device part ... My programmer isn't familiar to Flowcode ... Is there any other method to alternate the configuration of the device itself? ... Thanks in advance bro