The UPNLT must be configured for the required modulation method and comms settings each time it is powered up. To do this, the computer must send the UPNLT a string of configuration bytes via the comms port.
For the first (approximately) seven seconds after powerup U2 holds the CS8130 CONTROL/DATA pin low, which puts the CS8130 into "CONTROL" mode. During this period LED2 is on, and all bytes sent to the UPNLT from the computer are interpreted by the CS8130 as configuration bytes. After this period has elapsed LED2 switches off, the UPNLT receiver is enabled and all further bytes sent to the UPNLT from the computer are transmitted over the laser link.
The comms parameters for the configuration string are 9600 bits/second, 8 data bits, 1 stop bit, no parity.
The Windows program described on the next page provides a simple way to configure a UPNLT.
The following QBASIC program will configure a UPNLT for 115200 bits/second, 8 data bits, 1 stop bit.
OPEN "COM1:9600,N,8,1,CD0,CS0,DS0,OP0,RS,TB2048,RB2048" FOR RANDOM
AS #1
configstring$=CHR$(11)+CHR$(81)+CHR$(101)+CHR$(118)+CHR$(67)+CHR$(129)+CHR$(144)+CHR$(17)
PRINT #1, configstring$;
END
Notice the semicolon at the end of the PRINT statement, which results in the string being sent without a <CR> terminator character. <CR>, <LF> or null terminators must not be sent, as the UPNLT will interpret these as additional configuration bytes.
To use this program:
1) Connect the UPNLT to COM1 (to use a different comms port, change the OPEN
statement in the program)
2) Switch on power to the UPNLT, then a second or two later
3) Run the program
4) Wait until LED2 goes off, which occurs about 7 seconds after
powerup.
5) The UPNLT will now transmit and receive via the optical link
All the following examples are for IrDA modulation, 8 data bits, 1 stop bit, no parity. If other configurations are required for special applications, consult the CS8130 data sheet.
115200 baud
configstring$=CHR$(11)+CHR$(81)+CHR$(101)+CHR$(118)+CHR$(67)+CHR$(129)+CHR$(144)+CHR$(17)
57600 baud
configstring$=CHR$(11)+CHR$(81)+CHR$(101)+CHR$(118)+CHR$(67)+CHR$(131)+CHR$(144)+CHR$(17)
38400 baud
configstring$=CHR$(11)+CHR$(81)+CHR$(101)+CHR$(118)+CHR$(67)+CHR$(133)+CHR$(144)+CHR$(17)
19200 baud
configstring$=CHR$(11)+CHR$(81)+CHR$(101)+CHR$(118)+CHR$(67)+CHR$(139)+CHR$(144)+CHR$(17)
The UPNLT can be used without detailed knowledge of configuration string elements if one of the "Example Configuration Strings" (see above) is used.
The CS8130 is capable of IrDA SIR, ASK(CW), TV remote and Direct modulation schemes. A variety of receiver and transmitter choices is available within each of these schemes. Other aspects of the CS8130 operation are also configurable.
Please refer to the CS8130 data sheet if details of the possible options are required. Only the configuration settings required for normal operation of the UPNLT are described herein.
To configure the CS8130 for the UPNLT the configuration string should contain at least the following, in the order given, where:
bx = bit x of the byte
suffix B indicates a binary representation
suffix H indicates hexadecimal representation
suffix D indicates decimal representation
CS8130 Register 0 configuration, control register #1
b4 through b7 = 0000 ; register 0 address
b3=1 ; echo control characters
b2=0 ; not used
b1=1 ; enable receiver
b0=1 ; enable transmitter
Byte to send = 00001011B = 0BH = 11D
CS8130 Register 5 configuration, receive mode register
b4 through b7 = 0101 ; register 5 address
b3 through b0 = 0001 ; mode 1a, IrDA - fixed 1.6 uSec pulse
Byte to send = 01010001B = 51H = 81D
CS8130 Register 6 configuration, receiver sensitivity register #1
b4 through b7 = 0110 ; register 6 address
b3 through b0 = 1001 ; set receiver sensitivity to 5
Note: A receiver sensitivity setting of 4 or 5 is generally optimum, although
3 can often be used if the UPNLT is in a metal case connected to 0V. If the
setting is too low, electrical noise will trigger the receiver causing data
errors. Too high a setting desensitises the receiver and reduces range without
benefit.. A setting of 4 typically gives 5% to 10% greater range than a setting
of 5. Transceivers fitted with CS8130s with higher than average gain are
often triggered by noise at a setting of 3, so in this case a setting of
4 or 5 is optimum.
Byte to send = 01101001B = 65H = 101D
CS8130 Register 7, receiver sensitivity register #2 and demodulation
options
b4 through b7 = 0111 ; register 7 address
b3=0 ; not used
b2=1 ; enable ENPOS, ignore falling edge
b1=1 ; enable THIN option
b0=0 ; clear msb of receiver sensitivity setting
Byte to send = 01110110 = 76H = 118D
CS8130 Register 4, output power register
b4 through b7 = 0100 ; register 4 address
b3=0 ; not used
b2=0 ; disable BLKR thus allowing simultaneous receive and transmit
b1=1 ; enable LED2C output
b0=1 ; enable LED1C output
Byte to send = 01000011B = 43H = 67D
CS8130 Register 8, baud rate divisor register #1 (low nibble)
b4 through b7 = 1000 ; register 8 address
b3 through b0 ; low nibble of (3.6864E6/(16*BR))-1, where BR is the baud
rate in bits/second
=> 0001 for 115200
=> 0011 for 57600
=> 1001 for 38400
=> 1011 for 19200
Byte to send = 1000xxxxB, where xxxx depends on baud rate
CS8130 Register 9, baud rate divisor register #2 (high nibble)
b4 through b7 = 1001 ; register 9address
b3 through b0 ; high nibble of (3.6864E6/(16*BR))-1, where BR is the baud
rate in bits/second
=> 0000 for baudrates of 19200 or more
Byte to send = 10000000B = 90H = 144D for baudrates of 19200 or more
CS8130 Register 1, control register #2
b4 through b7 = 0001 ; register 1 address
b3=0 ; not used
b2=0 ; not used
b1=0 ; disable auto detect receive format
b0=1 ; load new baud rate
Byte to send = 00010001B = 11H = 17D