help needed with setting prescaller for ATmega 32

Status
Not open for further replies.

joephie

Newbie level 5
Joined
Sep 30, 2009
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
in ur heart
Activity points
1,327
[HELP] precise 1 second

can anyone help me calculating the prescale for ATmega 32 on Timer1 with crystal 11.0592 MHz. I'm using BASCOM but i don't know what is the prescale to make precise 1 second.

thank you
 

Re: [HELP] precise 1 second

Set the prescaler to 1024 and keep a 16bit counter in the interrupt routine to count to 10800(0x2a30), which will be 1 second exactly.
 

[HELP] precise 1 second

Yes do what bosparra said.
Use the compare module to count upto 10800 and then clear timer on compare (CTC) and generate interrupt on compare match.
 

Re: [HELP] precise 1 second

i'll give it a try guys.. but i have another problem on enabling the crystal. could anyone help setting up the fuse bit... wich part i should select? ? [CKSEL SUT CKOPT]
 

[HELP] precise 1 second

Set the fuse bits as:
CKOPT: 0(PROGRAMMED)
BOOTRST: 1(UNPROGRAMMED)
CKSEL3: 1(UNPROGRAMMED)
CKSEL2: 1(UNPROGRAMMED)
CKSEL1: 1(UNPROGRAMMED)
CKSEL0: 1(UNPROGRAMMED)
SUT1: 0(PROGRAMMED)
SUT0: 1(UNPROGRAMMED)
Hope this helped.
Tahmid.
 

Re: [HELP] precise 1 second

thank you very much for the help... but now im waiting the electricyti, it has been black out since yesterday ....oh my
 

Re: [HELP] precise 1 second

joephie said:
thank you very much for the help... but now im waiting the electricyti, it has been black out since yesterday ....oh my

are you from Iraq
 

this is my code


how would i know if my sistem is already running at precise 1 second.....
 

Hi,
That code seems to be written in BASCOM, am I right?
I use mikroBASIC and the codes look quite different. So I can't help you.
 

ouh, is there anyone can help....its been a headache to select the prescaler
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…