© 2001 Ubicom, Inc. All rights reserved.
- 3 -
www.ubicom.com
Asynchronous Transmitter & Receiver (UART) Virtual Peripheral Implementation
AN38
3.2
Bank Section
This section describes the use of the register banks in the UART Virtual Peripheral.
Inside this bank we have different banks for RS232TX, RS232RX, and Multiplex for clarity. Although there are three
banks, because all three are declared within bank 1, bank 1 becomes the current bank whenever any of these three
banks are accessed. Using different defines for each module allows the RAM definitions to be moved around in the
future to make space for other Virtual Peripherals in the same application.
Org
bank1_org
; VP: VP Begin RS232 Transmit
rs232TxBank
=
$
;UART bank
rs232TxHigh
ds
1
;hi byte to transmit
rs232TxLow
ds
1
;low byte to transmit
rs232TxCount
ds
1
;number of bits sent
rs232TxDivide
ds
1
;xmit timing (/16) counter
Rs232TxFlag
ds
1
;VP: END
;VP : VP Begin RS232 Receive
rs232RxBank
=
$
rs232RxCount
ds
1
;number of bits received
rs232RxDivide
ds
1
;receive timing counter
rs232RxByte
ds
1
;buffer for incoming byte
rs232Byte
ds
1
;used by serial routines
hex
ds
1
;VP: END
;VP : VP Begin Multiplexer
MultiplexBank
=
$
isrMultiplex
ds
1
;VP: END