Thanks! I messed up converting binary to octal. Your program helped a lot, and I missed it, I think because I figured that folder exclusively contained copies of what's in your videos. This stuff is probably super simple to you, but thanks for being so responsive on the forums! I hope you find it fun to guide beginners.
For others, these were the only changes necessary to make my program work, resulting in it outputting a 20.83 kHZ square wave.
Code: Select all
init:
mvi a, 003
out 020
toggle:
004
mvi a, 125
out 020
d1:
010
mvi a, 0
inr a
jnc d1
mvi a, 025
out 020
d2:
022
mvi a, 0
inr a
jnc d2
jmp toggle
Those values are all octal.
Here it is in octal opcodes:
Code: Select all
0 1 2 3 4 5 6 7
000: 076 003 323 020 076 125 323 020
010: 076 000 074 322 010 000 076 025
020: 323 020 076 000 074 322 022 000
030: 303 004 000
040:
050
Oh, one important thing. I was using pin 7 on my DB-9 connector (DB-25 to DB-9 straight-through cable), and for some reason it's toggling it on pin 8. I thought pin 8 was CTS and pin 7 is RTS. Maybe they're reversed at the terminating end? I probably don't understand something about serial.
Now I'm going to see if I can run CP/M over the 2nd SIO port (which I believe doesn't emulate CTS/RTS, as the admin menu says it's always asserted, IIRC). That'd let me do my RTS/CTS experiments on port 1, and use a more convenient environment on port 2.