Subject: RE: 8251 troubles
From: dwight elvey <dkelvey at hotmail.com>
Date: Sun, 27 Apr 2008 18:02:19 -0700
To: "General Discussion: On-Topic and Off-Topic Posts" <cctalk at
classiccmp.org>
From: cclist at
sydex.com
Date: Sun, 27 Apr 2008 08:23:09 -0700
From: dwight elvey
I'm going to assume that you have an 8251A, not an 8251. If the
latter, either sell it to a collector or have it bronzed and made
into a tieclasp. There are substantial differences between the -A
and non-A parts, all annoying.
Hi Chuck
The chip is a NEC 8251C.
NEC part number are D8251C for intel 8251 and D8251AC for intel 8251A
and the nec part have the same bugs for compatability (really!).
Glancing at your code, I'm a bit puzzled by the final initialization
byte of 0x10. Why isn't this, say, 0x37? Why would you disable the
receiver? 8251A commands are bit-inclusive; that is, ALL bits in the
command register are interpreted independently of one another. Thus,
0x10 sent to the command register doesn't just reset the error flags,
it also disables the transmitter and receiver and drops DTR and RTS.
I'd originally done a 37 but looking at some example code,
I thought I'd try separating out that bit. No change in results.
The data sheet seems to indicate that the flags will not effect
or stop operation.
Be very careful with soft reset as that means sending the whole command
string again and most users of 8251 reset the this many times (up to 3)
then write commands and read the data input a few times to clear it.
The implication is that since the command register's write-only, you
have to remember the last command you sent if you want to reset the
error flag. One of the minor annoyances of a few early Intel
peripherals.
Anent that last one--make certain that your handshake lines
(RTS/CTS/DTR) are set to the proper levels--an inactive CTS will
prevent the 8251A from transmitting.
At least at the port, there is no change. There could be something
at the chip. Since I've not even gotten to the sending serial, yet, CTS
isn't yet an issue.
First assure your self that the RS232 input device 1488/1489 arent
cooked and data is reaching RXD pin and there is clock and baud
clock of the correct rates.
Some 8080 code known to work.
INIT: ;...
LXI H,$7A37 USART 7 BITS, NO PARITY, HIGH-SPEED
CALL SETURT INITIALIZE 8251
;...
*
* INITIALIZES 8251 USART TO VALUE PASSED IN H-L
*
SETURT:
MVI A,3 VALUE TO RESET UART
OUT UCTL MAKE SURE.
OUT UCTL UART IS RESET
MVI A,$77 VALUE TO ENTER COMMAND MODE
OUT UCTL ENTER COMMAND MODE
MOV A,H GET HIGH BYTE OF NEW COMMAND WORD
OUT UCTL WRITE TO CONTROL PORT
MOV A,L GET LOW BYTE OF NEW COMMAND WORD
OUT UCTL WRITE TO CONTROL PORT
RET
Allison