[AVR] counter program for attiny24

Status
Not open for further replies.

farzinkalali

Newbie level 3
Joined
Oct 29, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
30
hi
I am trying to write a program in bascom for attiny24 that after counting 200 pulses set the pina.2
would you please help me
my program is like this


Code dot - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$regfile = "attiny24.dat "
 $crystal = 8000000
 
 Config Timer0 = Counter , Edge = Rising
 Start:
 Tcnt0 = 0
 Do
 
 Loop Until Tcnt0 = 200
 
 End
 
 Set Pina.2
 Wait 1
reset pina.2
 End





thank you
 
Last edited by a moderator:

Did you get the program compiled successfully?
If no,where are the errors,as shown by the compiler?
 

it compiled successfully
it dosen't work when I load it on proteous 7
it seems that it get stuck in the loop and don't get out of loop even when the count reaches to 200
 

Put
Code:
Start:
in line 3 instead of line 5,like you have done in the code.That should work out.
 

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…