roboforum.ruТехнический форум по робототехнике. |
|
|
пишите в любом из примеров CVAVR строку delay_ms(1000);
$regfile = "m16def.dat" ' specify the used micro
$crystal = 8000000
$lib "lcd4.lib"
Enable Interrupts 'Ðàçðåøàåì ïðåðûâàíèÿ
Config Lcdpin = Pin , Rs = Porta.0 , E = Porta.2 , Db4 = Porta.4 , Db5 = Porta.5 , Db6 = Porta.6 , Db7 = Porta.7
Config Lcd = 16 * 2
$baud = 19200 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
'*** Config the timer ***
Config Timer1 = Timer , Prescale = 256
' Timer1 is now UP, and an interrupt is only generated
' when the Timer1 register reaches 0
' To get an interrupt every 1000 timer ticks we load the
' TimerStart constant with 65536-1000
Const Timerstart = 65536 - 1000
' Load the TimerStart value into the Timer1 register
Timer1 = TimerStart
' Set the Timer1 interrupt pointer
' The Timer_1_int subroutine is executed when Timer1=0
On Timer1 Timer_1_int
' Enable the use of Timer1
Enable Timer1
' Enable the general use of interrupts
Enable Interrupts
'*** Variables ***
Dim A as Long
Dim A2 as Long
Dim B as Long
Dim B2 as Long
' Dim ShowA as Bit
'***** MAIN LOOP *****
Do
Locate 1 , 1
Lcd B
Loop
'***** END - MAIN LOOP *****
End 'end of Main program
'***** Subroutines and data area *****
'Subroutine which is called when Timer1=0
Timer_1_int:
' AVR Timers do not need a new START command to automatically keep running
' Timer1 is reloaded as to be ready for counting the next time slice
Timer1 = Timerstart
B = B + 1
Return
Модератор vooon:Буду бить банхамером если не будешь пользоваться тегом CODE!
Сейчас этот форум просматривают: GoGo.Ru [Bot] и гости: 2