prafful
Member level 2
- Joined
- Apr 3, 2011
- Messages
- 45
- Helped
- 28
- Reputation
- 56
- Reaction score
- 28
- Trophy points
- 1,298
- Location
- Rajkot, India
- Activity points
- 1,551
hi.
i want to count external pulse for my atmega16A.
here is my code
i m giving 4 hz pulse form 555 timer circuit to my controller.
but after all, lcd only displaying TIMER0 value on lowerline.
it is not counting any external pulse.
what to do???
i want to count external pulse for my atmega16A.
here is my code
Code:
$regfile = "m16def.dat"
$crystal = 8000000
Const Tick = 10
Dim Y As Byte
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Porta.4 , Db5 = Porta.5 , Db6 = Porta.6 , Db7 = Porta.7
Config Lcdpin = Pin , E = Porta.2 , Rs = Porta.0
Config Lcdmode = Port
Config Timer0 = Counter , Prescale = 1 , Edge = Rising
Load Timer0 , Tick
On Timer0 My_isr
Enable Timer0
Enable Interrupts
Display On
Lcd "Prafful Da Vinci"
Waitms 500
Do
Lowerline
Lcd "count" ; Timer0
Waitms 500
Cls
Loop
End
My_isr:
Load Timer0 , Tick
Y = Y + 1
Lcd Y
Return
i m giving 4 hz pulse form 555 timer circuit to my controller.
but after all, lcd only displaying TIMER0 value on lowerline.
it is not counting any external pulse.
what to do???