AVR - Timer+Input

r-cseh at freemail.hu r-cseh at freemail.hu
Sat Jan 22 10:49:10 CET 2005


Sziasztok!

AVR-l tanulgatok, belefutottam egy problemaba.

Fut a hatterben egy Timer szamlalo, es az input alatt vegrehajtodik egy ITrutin, de nem fogad utana az input adatot:(. Mit rontottam el?

Mellekelem a kodreszletet.
A holmi Mega16-ban fut.

Mit rontok el? Mi nem jo?

Robi



$regfile = "m16def.dat"
$crystal = 14745600
$baud = 9600
$lib "mcsbyteint.lbx"
Config Porta = Output


Config Timer1 = Timer , Prescale = 64
On Timer1 Isr_timer1                                        ' ISR for timer1.

Timer1 = 500                                                ' Interrupt kb. 1/sec
Enable Interrupts
Enable Timer1
Start Timer1
Dim I As Byte

I = 2
Do

Print I
Input "valami?" , I

Loop



Isr_timer1:
Timer1 = 500    
I = I + 1
Porta = I
Return

End

___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.2 - Release Date: 2005.01.21.




More information about the Elektro mailing list