Pages: 1 2 [3]   Go Down
Author Topic: arduino with internal oscillator on 1Mhz  (Read 32795 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks but slowly
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 150
veroboaring is the new XGame - Extreme Veroboarder
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley-razz

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
Frank
« Last Edit: May 17, 2010, 08:54:13 am by FrankRadio » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 150
veroboaring is the new XGame - Extreme Veroboarder
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

is DONE!

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

Bangalore, India
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://code.google.com/p/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.

Syntax:

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.


Logged

Katowice POLAND
Offline Offline
Full Member
***
Karma: 2
Posts: 127
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

is there a way to run narcoleptic on atmega8?
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 146
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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=16000000L
to
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
Logged

Pages: 1 2 [3]   Go Up
Jump to: