Go Down

Topic: arduino with internal oscillator on 1Mhz (Read 100782 times) previous topic - next topic


because changing the crystal will stop the downloader from working unless you reprogram and reflash it.


May 17, 2010, 03:53 pm Last Edit: May 17, 2010, 03:54 pm by FrankRadio Reason: 1
I'm working at a similar issue.
What i want to do is use a 3.579545 TXCO as external clock source.
Now i do all the things i found.

My list is:
1) Change at makefile, Xtal value, BPS value for that who have less error, for this case is 9600BPS (I use AVR calculator to analize this)
2) Change all the fuse bits to use an external clock source (H fuse = d0)
3) Rebuild the .HEX file
4) Include a new CPU at boards.txt, in that change all again, xtal freq, buse bits, serial speed.

But i can download a scketch file to the CPU, in fact i never see the E0 when de CPU runs loading the scketch HEX file. :P

I was doing the maths about this:
UBRRH = (((F_CPU/BAUD_RATE)/16)-1)>>8;       // set baud rate
 UBRRL = (((F_CPU/BAUD_RATE)/16)-1);
 UCSRB = (1<<RXEN)|(1<<TXEN);  // enable Rx & Tx
 UCSRC = (1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0);  // config USART; 8N1

But it's OK and the maths of this and the obtained from the AVR calculator are the same, in fact the error at 3.579545 in 9600BPS is less that 0.2%.

Ideasssssss??? I'm stuck here  :-[

Best Regards


is DONE!

Cheq this:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1273962209  :o


This may be of interest to some who've been following this thread -- Peter Knight has written a library called Narcoleptic:


Library implementing sleep modes, allowing extremely low power consumption on Arduino based projects.

Narcoleptic uses the sleep functionality of the AVR microcontroller to almost completely shut down the entire CPU, just leaving a low power timer running to trigger the wake up.

Extract the download, and install in your Arduino Libraries directory. Restart Arduino and you will see the Narcoleptic library appear in the menus.


Narcoleptic.delay( time in milliseconds )

Note that Narcoleptic timings are only accurate to a few percent. Whilst sleeping, everything is stopped - including PWM outputs, the millis() timer, serial ports - everything. So code with this in mind.



is there a way to run narcoleptic on atmega8?


i just read 5-6 topics on how to use the internal oscilator

but i am also stuck in something

i can reprogram the fuses with avrdude and a usbtinyisp programmer
so the atmega will run on 8Mhz of the internal or 1Mhz

so far so good

now when get the hex from the blink code and upload it to arduino(without the bootloade)

and the 1sec is actualy 2sec (on 8Mhz) or 16(on 1Mhz)

ok i was expecting that

now i am changing olny that from the boards.txt file

atmega328.build.f_cpu=8000000L  or  atmega328.build.f_cpu=1000000L

then i remake the hex and upload it again to arduino

and the led blinks normanly in 1sec

but when i am changing the

delay(1000) in the code with the
delayMicroseconds (1000000)

it dosent work

so how can we fix that?

thanks a lot

*i dont care for bootloader - i dont use it anymore

Go Up