Hi all.
As per my last post (
http://forum.6502.org/viewtopic.php?f=2&t=7750) I have a working system from a hardware perspective. I'm now concentrating on software and learning to extend Wozmon, understand how it works and use that knowledge to roll my own monitor. Ironing out the wrinkles is where I'm at currently, and I'm so grateful for the assistance with my LCD initialisation problem - that's one off my list of wrinkles!
My SBC specs are a 65C02 running at 3.6864Mhz with a 1x65C22 VIA and a 65C51. 16 kB of RAM and 32 kB ROM. The UART is connected via an FTDI to USB and I communicate through /dev/ttyUSB0 on my Linux box using minicom. The 65C51 is fed from the system oscillator at 3.6864Mhz.
One of the major milestones in my build (any build?) was being able to transfer a program from PC over serial to the SBC. I suppose there are lots of ways to do this. The way I have adopted it to develop my own "toolchain" of shell scripts and python apps that will assemble my source code, output a Motorola S19 format, process that S19 into a Wozmon friendly format and, finally, upload to the SBC.
Whilst this works, it is not without its wrinkles. In his YouTube videos, Ben Eater does something similar where he post-processed assembler output into a format identical to how one would type it into Wozman. However, when I did that and pasted into the terminal (like Ben did), it goes wrong - it is as if there's a "traffic jam" of characters.
For example, pasting a line like this...
Code:
0400:A0 00 20 15 FF C9 1B F0 F7 C9 08 F0 15 99 40 02 20 18 FF C9 0D F0 15 C8 10 E8 88 A9 08 20 18 FF
Becomes...
Code:
0400A0 0 0 1 F C91BF0 7 C 0 F01599 0 2 2 1 FFC9 D 0 1 C 10E888 9 0 2 18FF
The way I got around this was writing a python app to do the uploading instead which included delays - snippet here...
Code:
for line in data:
for c in line:
sbc.write(c.encode('utf-8'))
time.sleep(0.001) # wait between sending characters.
sbc.write(b'\x0D') # send a CR at the end of each line.
time.sleep(0.01) # wait a bit longer between sending lines.
Introducing a 1ms delay between sending characters and a further 10ms after sending a CR does the trick. But why does this happen?
Is it because there is no flow control? Should I hook up RTS/CTS? (I don't know how, BTW!). The 65C51 datasheet shows the baudrates for a 1.8432Mhz oscillator. As I am at 2x this, I understand that when selecting 19200, I am actually running at 38400. That's what minicom is set to and there is no problem in communicating with my SBC ordinarily. It's just when I attempt to push a lot of data at it.
Is RTS/CTS the answer? Is there a lot of software required to make that work? Do I leave well alone? Maybe rewrite/extend Wozmon to turn off echo when uploading?
I can't help but think I'm not the first to have come across this problem.
As ever, any pointers most welcome.
Thanks in advance.
Dave