PIC模拟异步串行通讯UART
用TMR0实现定时查询。任何带中断的PIC上都可以实现。可用此法扩展多个串口。
;|--------------------------------------------------------------|
;| Implement duplex USART base on normal I/O pin |
;| Using TIMER0 interrupt for bit timing |
;| Tested on PIC16F83 running at 4MHz |
;| Written by Paul Zhang, Microchip Tech Inc |
;| 6 Aug, 2000 |
;| All rights reserved |
;|--------------------------------------------------------------|
errorlevel -302 ;no bank warning
errorlevel -301 ;no default file warning
list p=16F83 ;define processor
#include ;
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC……