Overview
Protean Logic Inc.'s RSB509C-x is an easy to use, low cost IC that buffers RS232 serial data for a host microprocessor. The RSB509C-x stores up to 32 bytes of serial data received on the input pin and retransmits data to the host through the interface pin. The RSB509C-x frees the host microprocessor from serial data timing concerns. The real time considerations of RS232 interrupt handling are thus eliminated or reduced. Processors that emulate RS232 hardware via software, like the FBasic TICkit or the PARALLAX Basic STAMP, can perform other tasks while the RSB509C-x buffers serial data. The processor can retrieve the stored data when it has the time to spare by pulsing the interface pin. When using a TICkit or a STAMP as the host processor, the user program simply outputs a high on the interface pin immediately before the rs_receive or serin line.
Connecting the RSB509C-x is easy. Only a few pull down resistors and a crystal or resonator is required. The RSB509C-x only requires one connection line to the host processor. The RSB509C-x is an enhanced version of the RSB509B. The RSB509C-x has an embedded address of 1 or 0 (hence the “x” in the part number) that allows two RSB509C’s to share a single interface line.
· Small 8-pin plastic DIP package.
· Requires 4MHz clock source (crystal or resonator); pull down resistors for data, empty, and ready outputs.
· 32 byte buffer transparently receives data and retransmits it to the host when requested.
· Only one host processor pin required to completely interface to RSB509C-x.
· Pulse protocol on the interface pin is used to program the RSB509C-x operation modes and to regulate data transfer.
· Programmable input baud rates of 9600, 4800, 2400 or 1200. Lower baud rates possible by lowering clock frequency.
· Receive input pin programmable for inverted (pull down) or non-inverted (RS232 driver output) signal polarity.
· Up to two RSB509C’s interface with the host at 9600 baud via open drain pin.
· Host indicates it is ready to receive by bringing the data line high momentarily. Host emulation routine makes interface pin an input when it starts which inherently signals the RSB509C-x to send data from the buffer.
· Programmable single byte or burst mode transferred to host.
· Programmable byte match before buffer option for addressable packet reception.
· Programmable break required before byte match option.
· Buffer empty output and buffer full (/ready) output for handshaking and buffer status.
TICkit 62 Connection Diagram STAMP™ II Connection Diagram
TICkit 62 Sample Program
;
Program for RSB509A serial buffering
DEF
tic62_c
LIB
fbasic.lib
LIB
rsb509c.lib
FUNC
none main
BEGIN
; generate a long pulse on interface pin to
; signal initialization to RSB509
pin_high( pin_d0 )
delay( 10 )
=( in_err, pin_in( pin_d0 ))
; interface input is inverted and 9600 baud.
rs_param_set( rs_invert | rs_9600 | pin_d0 )
; RSB509 programmed for inverted input at 9600
rs_send( rsb509_invert | rsb509_baud1 )
; no match byte used but one could be sent
; here if the mode required it
; rs_send( ' ' )
delay( 100 )
REPEAT
; generate a quick pulse for each
; byte to be read. pin high creates start
; of pulse. rs_receive creates end of pulse
; when it makes the pin an input.
pin_high( pin_d0 )
; pin D0 will be used for input
rs_param_set( rs_invert | rs_9600 | pin_d0 )
; read each byte with a short wait
=( in_val, rs_receive( 100, 0b, in_err ))
IF in_err
ELSE
rs_param_set( debug_pin )
con_out_char( in_val )
ENDIF
LOOP
ENDFUN
Basic Stamp II Sample Program
'
sample program for RSB509 on STAMP II
inval
VAR byte
'
generate a 10 ms pulse to signal initialization
HIGH
1
PAUSE
10
INPUT
1
'
pin P1 is used for interface to RSB509.
'
we are using open, inverted, 9600, 8N1 format
'
RSB is programmed for normal (driver level inputs)
'
at 9600 baud.
SEROUT
1, 49236, [%00000000]
'
no match byte is used but could se a byte here
'
if the RSB mode required it
'
SEROUT 1, 49236, [" "]
'
wait for RSB509 to reset
PAUSE
100
around:
'
generate a quick pulse for each byte
'
to be read. HIGH creates the start of
'
the pulse. SERIN creates the end of the
'
pulse when it makes the pin an input
'
because the interface pin is pulled low
HIGH
1
'
pin P1 is used for input.
'
we are using open, inverted, 9600, 8N1 format
'
if a byte is not received within 1 ms branch to
'
"around" to poll again.
'
data will only be displayed when byte is received
SERIN
1, 16468, 1, around, [inval]
'
show character received on debug window
DEBUG
inval
GOTO
around
END
REV 11/00