HTBasic Help
×
Menu
Index

Interface Status Errors

 
An interface status error, Error 167, may occur when the cabling, communication parameters, or data formats are not correct. The error is not reported when it occurs but when you access the interface with ENTER or OUTPUT. To discover what the error was, execute the statement:
 
PRINT IVAL$(STATUS(9,10),2)
 
This reads the UART line status register. The meaning of the bits is
 
Bit
Value
Meaning
7
128
Not used
6
64
Transmit Shift Register Empty
5
32
Transmit Holding Register Empty
4
16
Break Detect
3
8
Framing Error
2
4
Parity Error
1
2
Overrun Error
0
1
Data Ready
 
Only bits 1 to 4 represent errors and bit 4 is not necessarily an error, if the device intended to get your attention by sending a BREAK indication. If several of the error bits are set, the meaning of the bits may not reflect the actual problem; you probably have the baud rate or character format set differently on the device and the computer.
 
If only a single error bit is set, the chances are good that the meaning of that bit reflects the actual error. A framing error indicates that the character did not end when it was supposed to. You probably have the number of data or stop bits set differently on the device and computer. A parity error means that the expected parity bit of the character was different than expected. You probably have the parity set differently on the device and computer. An overrun error means that a character was sent to the computer when the computer was not ready to receive it. You may not have handshaking set up correctly. You may not have executed the proper CONTROL statements, wired the cable correctly, or set up the device to handshake.
 
Keep in mind that RESET and SCRATCH will reset the communication parameters to the values specified with CONTROL registers 13 and 14. STATUS(9,3) and STATUS(9,4) may be used at any time to check the values of the baud rate and character format to see if they are what you expect.
 
Spurious interface status errors can be caused by turning the power to the computer or device on or off. To prevent an error on the ENTER or OUTPUT statement, the error can be cleared by STATUS(9,10) or by RESET 9.