0979 1E9E ; PRINT 1 CHAR CHAR IN A 0980 1E9E ; X IS PRESERVED, Y RETURNED IS FF 0981 1E9E ; OUTSP PRINTS 1 SPACE 0982 1E9E ; 0983 1E9E A9 20 OUTSP LDA #$20 ; PRINT SPACE 0984 1EA0 85 FE OUTCH STA CHAR 0985 1EA2 86 FD STX TMPX 0986 1EA4 20 D4 1E JSR DELAY ; DELAY 10/11 BIT CODE SYNC 0987 1EA7 AD 42 17 LDA SBD ; START BIT 0988 1EAA 29 FE AND #$FE 0989 1EAC 8D 42 17 STA SBD 0990 1EAF 20 D4 1E JSR DELAY 0991 1EB2 A2 08 LDX #$08 0992 1EB4 AD 42 17 OUT1 LDA SBD ; DATA BIT 0993 1EB7 29 FE AND #$FE 0994 1EB9 46 FE LSR CHAR 0995 1EBB 69 00 ADC #$00 0996 1EBD 8D 42 17 STA SBD 0997 1EC0 20 D4 1E JSR DELAY 0998 1EC3 CA DEX 0999 1EC4 D0 EE BNE OUT1 1000 1EC6 AD 42 17 LDA SBD ; STOP BIT 1001 1EC9 09 01 ORA #$01 1002 1ECB 8D 42 17 STA SBD 1003 1ECE 20 D4 1E JSR DELAY ; STOP BIT 1004 1ED1 A6 FD LDX TMPX ; RESTORE INDEX 1005 1ED3 60 RTS
A subroutine that sends out an 8 bit character via the serial TTY output followed by one stop bit via bitbanging to PB7. Contrary to GETCH this allow 8 bits characters.
The receiving device should be set to 8N1 (8 databits, no parity, 1 stopbit)
Timing is done with the 1 bit DELAY routine.
A and Y are lost, X preserved.
What happens here?
– The character to send is stored at zeropage CHAR.
– save X
– A 1 bit delay, just to be sure
– set PB7 to the start bit 0
– a 1 bit delay
– get current value of PB7 (LDA SBD and AND #$FE)
– shift databit into carry (LSR CHAR)
– set carry to PB7 (ADC #$00 and STA SBD)
– delay 1 bit
– repeat for 8 databits
– set stop bit 1
– delay 1 bit, leave PB7 in rest state
– restore X
See also:
TERC KIM-1 Interface set
A recent acquisition, the TERC (Technical Education Research Centers) KIM-1 Interface set. An educational tool to work w...
6502 tester NMOS CMOS 1-8MHz
The 6502 W65C02 6502C CPU tester NMOS / CMOS 1-8MHz is a CPU tester for 40 pin 6502/65C02 and WD65C02 and Sally.
The...
680x/650x Test system
The 680x/650x Test system allows to test, with the CPU itself performing the test, the MC680X and MCS650X families.
T...
Backbit Chip Tester PRO V2
A simple tio use and effective component test and ROM dump can be done with the wonderful Backbit Chiptester Pro V2.
...