; ; ctrlcomm.h ; TITLE "RS-232 communication for all controllers" ; ; Equates ; ; Interrupt rate is baud rate x 4. 2 extra counts to get to the centre ; of the start bit, 9 x 4 bits for 8 data bits and half of start and ; stop bits. ; DbgComm equ 0 ; If not 0, it's debug mode ; TickCount equ 2 ; 2^2 = 4 ticks per bit SerCount equ ((0ah<<TickCount)+2) StartBit equ (0ah<<TickCount) StopBit equ (1<<TickCount) CountMask equ ((1<<TickCount)-1) ; P1RxIn equ 7 P1TxOut equ 6 ; if DbgComm != 0 BitDbg equ 5 ByteDbg equ 4 endif ; ; Status bits RxRdy equ 0 RxBusy equ 1 TxRdy equ 2 TxBusy equ 3 RxOver equ 4 FramErr equ 5 ; ; Data ; ; Port 1 data P1Stat RES 1 ; Status bits P1TxSr RES 1 ; Transmit shift register P1TxByte RES 1 ; Transmit holding register P1RxSr RES 1 ; Receive shift register P1RxByte RES 1 ; Recieve holding register P1TxCount RES 1 ; Transmit bit count P1RxCount RES 1 ; Receive bit count
None.