Date : Mon, 06 Jan 1986 19:57:08 EST
From : Mike Spitzer <inuxc!pur-ee!mjs@ucb-vax.ARPA>
Subject: Thanks for you help with the 8251
Thanks for all of your help with the 8251. My problem was with the
number that I was sending to put the chip back in "normal" mode
after initializing. I also need a dummy read from the data port after
initializing. Thanks to mknox@ngp.UTEXAS for sending me the
right number to use. The following code works fine for me:
;MODEM PORT EQUATES
MCNTR EQU 41H ;Modem control port
MDATA EQU 40H
RESET EQU 01000000B ;Value for port reset
MINIT1 EQU 01111110B ;Modem init value for baud, etc
MINIT2 EQU 00110111B ;puts it back in "normal" mode
; ^^^^^^^^^ this is what I changed
ORG 100H
INITIALISE: MVI A,RESET ;Puts 8251 in instruction mode
OUT MCNTR ;
NOP
NOP
MVI A,MINIT1 ;sets up baud, etc.
OUT MCNTR ;
NOP
NOP
MVI A,MINIT2 ;Puts 8251 back in normal mode
OUT MCNTR
NOP
NOP
IN MDATA ; I added this line to my original code
JMP 0 ; the warm-boot didn't hurt anything
If anyone is interested in a rather large collection of hints for
programming the 8251, let me know via mail and I'll send it to you.
Thanks again,
Mike -- mjs@purdue-ecn -- pur-ee!mjs