用PIC低档单片机模拟串口通讯.
movlw D14 ;
movwf temp2 ;
movlw 0 ; 0-1,will be overflow to 255.
movwf temp ; (774+3)*14~=11ms
lp1 ; delay about 11ms?
call UART_delay ; 256*3+6=774 clock.
decfsz temp2,f ;
goto lp1 ;
retlw 0
;*
delay
clrf TIMER0
d1s MOVLW D255 ;
SUBWF TIMER0,w ;TIMER0
BTFSS STATUS,Z ;
GOTO d1s
retlw 0
;main loop
;
;
;
main
call delay
btfss GPIO,Fw
goto fwd
nop
nop
btfss GPIO,Rw
goto rev
nop
nop
btfss GPIO,Vd
goto vdo
nop
nop
btfss GPIO,Vp
goto vpl
nop
nop
btfss GPIO,Pa
goto pypa
nop
goto main
fwd
movlw 010H
movwf Txipod1
movlw 0EBH
movwf Txipod2
call ipod_packet
btfss GPIO,Fw
goto fwd
goto rel ;goto release....
rev
movlw 08H
movwf Txipod1
movlw 0F3H
movwf Txipod2
call ipod_packet
btfss GPIO,Rw
goto rev
goto rel ;goto release....
vdo
movlw 04H
movwf Txipod1
movlw 0F7H
movwf Txipod2
call ipod_packet
btfss GPIO,Vd
goto vdo
goto rel ;goto release....
vpl
movlw 02H
movwf Txipod1
movlw 0E9H
movwf Txipod2
call ipod_packet
btfss GPIO,Vp
goto vpl
goto rel ;goto release....
pypa
movlw 01H
movwf Txipod1
movlw 0FAH
movwf Txipod2
call ipod_packet
btfss GPIO,Pa
goto pypa
goto rel ;goto release....
rel
movlw 0
movwf Txipod1
movlw 0FBH
movwf Txipod2
call ipod_packet
goto main
end
PIC低档单片机模拟串口通讯 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)