BASCOM AVR 编程记录01

<code>$regfile="m168def.dat"
$crystal= 8000000
Config Timer1 =Timer, Prescale=1

$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 Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
Open "com1:" For Binary As #1

Enable Interrupts
Enable Ovf1
Enable URXC
On URXC Receive_isr
On Ovf1 Overflow_isr
dim b1 as byte

Ddrc=&Hff
Timer1=65130

Print "Hello"

Dim B As Byte


Do
Nop
Input "test serial port 0" , B

Print B

Print #1 , "test serial port 2"

Loop
End

Overflow_isr:
Portc.0=not Portc.0
Timer1=65130
Return

Receive_isr:
input b1
Portc.1=not Portc.1
Return/<code>


BASCOM AVR 编程记录01


分享到:


相關文章: