greetings.
My newly assembled POV3 kit worked fine when running all of the firmware code provided.
I tried to load ledcube.hex provided by the online tutorial at make magazine.
Everything seemed fine until the lfuse error appeared during the download.
After looking through the forum, I entered 'n' when asked about changing the
setting. The fuse question was asked three more times..each answered, 'n'...
the execution ended and then 'nothing'.
Using the dasa downloading, all the original .hex files run as before; however,
although files digg.c and minipov.c each download fine they run too fast.
The frequency of the LED's are so high that they almost look like they are just on.
I went through the Makefile and found the line for 'burn-fuse' and ran it
on the command line. There was no change to the LED frequency.
As a newbie, I'm assuming that some prescaler (?) in the Tiny2313 clock setting
must have been changed ?!?
I know I'm close....
I would sure appreciate any suggestions.
lfuse and now a change in clock frequency
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: lfuse and now a change in clock frequency
dont think so, the minipov3 is already running on the 8mhz internal oscillator and thats as fast as it goes. try mucking with the frequency divider line to change the speed?
-
- Posts: 4
- Joined: Tue Sep 21, 2010 4:12 pm
Re: lfuse and now a change in clock frequency
Does anyone know if I can slow this Minipov3 waaaaaaaaaaay down??? And how to do it??
Tim
Tim
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: lfuse and now a change in clock frequency
The timing calculation is described in detail at the beginning of the main() function in mypov.c. You can play with the prescale and/or overflow values until you get the effect that you want.
-
- Posts: 4
- Joined: Tue Sep 21, 2010 4:12 pm
Re: lfuse and now a change in clock frequency
I'm missing it. I don't do alot of programing. I have changed all kinds of things and can't get it to slow down. Then reloaded the file from source code and started again.
Could you please copy and paste what lines of code I need to change.
Thanks
Tim
Could you please copy and paste what lines of code I need to change.
Thanks
Tim
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: lfuse and now a change in clock frequency
Code: Select all
/*
the frequency of the interrupt overflow is determined by the
prescaler and overflow value.
freq = clock_frequency / ( 2 * prescaler * overflow_val)
where prescaler can be 1, 8, 64, 256, or 1024
clock_freq is 8MHz
and overflow_val is 16bit
the overflow value is placed in OCR1A, the prescale is set in TCCR1B
so for example:
A good POV frequency is around 400Hz
desired freq = 400Hz
clock freq = 8MHz
8MHz / (400Hz * 2) = 10000
since 10000 is less than 655536 (largest 16 bit number)
OCR1A = 10000 and the prescale is 1
*/
TCCR1B = (1 << WGM12) | TIMER1_PRESCALE_1;
OCR1A = (uint16_t)10000;
TIMSK |= 1 << OCIE1A; // Output Compare Interrupt Enable (timer 1, OCR1A)
Or you can increase the value assigned to OCR1A. If you change the 1000 to a 2000 it will be half as fast.
Please be positive and constructive with your questions and comments.