Apple 1 Replica has occasional repeating characters

10 replies [Last post]
CWJ_Wilko's picture
Offline
Joined: Jun 3 2015
Posts: 272

I've spent the day diagnosing my homebrew Apple 1 replica, based around Vince Briel's Replica 1 Plus. The Woz Monitor is loading and I can get into BASIC using E000R on the larger ROM, so that's a great sign. I'm using a real CRT screen but input is via serial to PuTTY on my Windows 10 machine.

The only real trouble I'm having with it still is with repeating characters. Whenever I type a 'space' it produces a single space character. But whatever character I type next, it first produces another space character, before sending the requested character. So I'm basically getting double spaces between every word and command. It's not just the space character, either.

I get doubles every time with the space character, about 80% of the time with the 0 (zero) character, and about 10% of the time with other characters. It even happens with Return, for example, if I type F000, and then Return, I will sometimes get an extra 0 before the Return character it sent, which sends F0000 and produces an error. I'm suspecting the Propeller has an issue, I've checked my work carefully several times and it seems like an oddly specific error.

I haven't actually wired up a PS/2 keyboard yet, I need to do that next to see if I get the same repeats, just to narrow things down further.

Have any Apple 1 replica owners/builders had an issue like this?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Offline
Joined: Oct 9 2011
Posts: 1057
Re: Apple 1 Replica has occasional repeating characters

How are you sending serial data in? Could you have a mismatch in number of bits or something? Is the propellor bit banging the serial?

CWJ_Wilko's picture
Offline
Joined: Jun 3 2015
Posts: 272
Re: Apple 1 Replica has occasional repeating characters

The manual has:

9600 baud
8 data bits
1 stop bit
No flow control
No parity

Obviously set to all these, still the same problem. I can actually change these settings and still get a working terminal with some lee-way, but still doesn't fix the extra space character.

Today I'm getting very few other characters repeating, but still always an extra space!

Not knowledgeable enough to know whether its 'bit banging' or not, the Replica 1 Plus that I've built this around uses a FT232R breakout for serial connectivity. The Propeller P8X32A controls the keyboard, serial I/O and video. The computer otherwise seems to be 'computing' just fine. Might need to get another Propeller and note any differences, if any.

CWJ_Wilko's picture
Offline
Joined: Jun 3 2015
Posts: 272
Re: Apple 1 Replica has occasional repeating characters

Quick update on this, I'm getting the same problem with a different Propeller chip, I've also tried multiple combinations of 6502 and 6821 PIA chips, so I'm assuming it's my wiring somewhere. This just doesn't make sense to me though, it's still such a specific misfire. I may try replace the RESET and CLEAR buttons, these seem to be a bit flaky, I don't know how they would affect sending text over serial, but want to eliminate everything possible.

It could also be the FT232R breakout, I have a replacement but will need to solder it in.

CWJ_Wilko's picture
Offline
Joined: Jun 3 2015
Posts: 272
Re: Apple 1 Replica has occasional repeating characters

Even with the PS/2 keyboard hooked up, I am getting the odd space. But for some reason now, they are much less frequent.

Offline
Joined: Oct 9 2011
Posts: 1057
Re: Apple 1 Replica has occasional repeating characters

This is starting to sound like a shorted wire or pin somewhere.

Offline
Joined: Jun 5 2008
Posts: 381
Re: Apple 1 Replica has occasional repeating characters

It is possible that it is a gound plane or other signal integrity issue. If you have looked for ground bounce during keyboard reads?

regards,
Mike Willegal

CWJ_Wilko's picture
Offline
Joined: Jun 3 2015
Posts: 272
Re: Apple 1 Replica has occasional repeating characters

Thanks for the advice all. I tend to agree with all the above - while I have checked my soldering and pins several times now, I still may have missed something, and resoldering a few connections won't hurt. Not having a ground plane is interesting, and I can assume when dealing with sensitive electronics such as this, ground plane and induction could definitely come into play.

When pushing a text file over terminal to the Apple 1, the errors get much worse, lots of missing 0s and just strange misfirings. Could line up with the above diagnoses.

There are a few things I want to try:

- Replace the reset and clear buttons, or remove them completely, to rule out any shorts in the physical switch
- Add more paths to ground (this could be key?)
- Reroute the connections between the PIA and the Propeller away from everything else, to rule out induction
- Add filtering capacitor to Propeller (this absolutely needs to be done, I don't know why I skipped it).

What is the best way to look for a ground bounce?

Offline
Joined: Oct 9 2011
Posts: 1057
Re: Apple 1 Replica has occasional repeating characters

Did a bit more thinking on this, and Mike is on to something, since it's worse with serial than PS/2, but the problem still manifests it is leaning towards a ground problem. If you have access to an optoisolator on the serial and it acts more like the PS/2, then ground it is. I'd also check the ground to make sure you have enough copper in the ground plane. Also try to add some extra decoupling caps just in case not just to the propeller, but around the whole board. Use Tantalums they are better than ceramic caps for this.

CWJ_Wilko's picture
Offline
Joined: Jun 3 2015
Posts: 272
Re: Apple 1 Replica has occasional repeating characters

Thanks Corey. Got some more symptoms for you all.

After turning off, then back on after 24 hours, I was able to physically manifest random characters on the screen just by moving or touching one of the buses between the PIA and the Propeller. This included non-Apple characters that are still in the Propeller firmware, like arrows, etc. After a minute no amount of prodding would cause any affect, but still getting the odd space character. I would still say it's less often with the PS/2 keyboard.

I've also noticed that when sending text over serial, or typing very very very quickly (like the same character over and over), I will occasionally get a \ character (like when you reset the CPU) and get a carriage return, except that I stay in BASIC. To me this seems like a mini-crash, like the CPU isn't getting enough power for the briefest of moments.

I'm going to focus on increasing the amount of copper to ground, I've noticed now that I have daisy-chained a single pitiful TINY copper wire between the PIA, RESET switch, ROM and then to the RS232 board, think this wasn't a good move. The RS232 has two ground connections and I'm only using one (well the other one is connected - to ground. D'oh!!) EDIT: Also just noticed that I have daisy chained ground from the Propeller, to the EEPROM, to the logic gates, to the 6502, to the ROM, then to the RS232 - really don't know what I was thinking here, I know enough about this sort of thing to know to add plenty of ground.

I think I'll start replacing all the ground connections with thicker copper wiring, and run everything twice to each pin on the RS232. Would it be worth running separate copper wiring for each IC's ground pin(s) back to the RS232, rather than chaining them together? Would this help with any induction and overall electric capacity? Perhaps I should separate the Propeller and EEPROM from the rest of the circuit by using different paths to ground?

The Propeller is the only IC missing a filtering cap, every other IC has one including the logic gates. I must have just ran out and forgot. I think I have some spares, and it'll be an easy fix.

Not much more to say at this point, except that despite the problems, it feels super awesome to have this sort of working. I'm a talented amateur with electronics but far from perfect, this was a really big project for me. I'm actually thrilled to have gotten this far. I really wanted to push myself to avoid a PCB and 'enjoy' all this problem solving.

CWJ_Wilko's picture
Offline
Joined: Jun 3 2015
Posts: 272
Re: Apple 1 Replica has occasional repeating characters

We're in business! Extra paths to ground now, and I added the filter cap, and I'm getting flawless keyboard and serial input.

This is awesome.