Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top