6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 3:35 pm

All times are UTC




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: LCD Text jumbled on 6502
PostPosted: Wed Dec 14, 2022 7:25 pm 
Offline

Joined: Wed Dec 14, 2022 11:54 am
Posts: 4
Hi everyone, I recently finished my 6502 build, but am running into some issues with Ben's hello-world and hello-world-final programs. It's running the original hello world program and the LCD text appears jumbled, and sometimes it doesn't show up at all. Additionally, when I run hello-world-final nothing on the LCD shows up. I'm pretty sure everything is wired correctly, however it's certainly possible I screwed something up. I suspect it has something to do with the crystal clock, but that's just speculation on my part. I don't have the timer module to test the computer at slower speeds.

I'm a bit new to this, so sorry if this is a silly question. Also, I know my wiring is a bit messy, and sometimes I stipped a bit too much but I plan to clean it up a bit once I get these issues sorted out.


Attachments:
File comment: All screwy. Ignore the messy wires
20221214_122242.jpg
20221214_122242.jpg [ 2.73 MiB | Viewed 415570 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 14, 2022 7:30 pm 
Offline
User avatar

Joined: Tue Oct 25, 2016 8:56 pm
Posts: 362
Welcome to the forum!

Can you please post a schematic for what you've built (doesn't have to be beautiful), and a link to the code you're trying to run? it will be difficult to help you without that info, I think.

_________________
Want to design a PCB for your project? I strongly recommend KiCad. Its free, its multiplatform, and its easy to learn!
Also, I maintain KiCad libraries of Retro Computing and Arduino components you might find useful.


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 14, 2022 7:38 pm 
Offline

Joined: Wed Dec 14, 2022 11:54 am
Posts: 4
Sorry, I forgot about that. The code can be viewed as plain text here: https://eater.net/downloads/hello-world.s


Attachments:
6502.png
6502.png [ 447.01 KiB | Viewed 415566 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 14, 2022 8:11 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Welcome, besser435 :)

Thanks for posting the schematic. Some folks prefer monochrome, so I've taken the liberty of providing that for you. Cheers,

Jeff


Attachments:
6502 mono.png
6502 mono.png [ 78.38 KiB | Viewed 415559 times ]

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 14, 2022 8:35 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
Hello besser435,

Well, that's Ben Eater's machine (nicely made too) and his code, so its not the code in error. I'm going to be really cute here and say "its a wiring problem" :-)

Exactly what is wrong is anyone's guess (I suspect not the address lines but it could be :-) )

I think step one is go through it wire by wire, connection by connection with a simple multimeter and check good continuity on all wires from where you expect to where you expect and also to where you DON'T expect. Make sure you test from chip pin to chip pin and not just "contunuity" but good continuity i.e. very low resistance. I had a bad time with breadboard so this is the voice of experience!


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 14, 2022 10:09 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
It's true. Low-quality breadboards -- which unfortunately are all too common -- have been the source of a lot of grief. Our own breadboard wizard, Radical Brad, recommends those made by Twin Industries.

On a different topic, what happened to the circuit board for the LCD ?! :shock: It looks as if a hole was drilled in it, which very possibly could have severed some of the traces. If so, that could explain the difficulties you're experiencing. It looks to me as if your project is 95% working... but something's gone awry in the very final stage, ie -- displaying the output.

I think it'd be helpful to see a photo showing a rear view of that LCD assembly.

-- Jeff


Attachments:
lcd closeup.jpg
lcd closeup.jpg [ 147.92 KiB | Viewed 415543 times ]

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Wed Dec 14, 2022 10:16 pm, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 14, 2022 10:12 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
Dr Jefyll wrote:
On a different topic, what happened to the circuit board for the LCD? :shock: It looks as if a hole was drilled in it
Well spotted! That's usually where the LED backlight is.


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 14, 2022 10:25 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Welcome, besser435.  There are several possible sources of the trouble, one being the construction method being on solderless breadboards.  See more about that in the applicable section of the 6502 primer.  (Do go through the whole 6502 primer though, as it addresses the many aspects of making your own computer, including many that the beginner would never have thought of to even ask about.  The sections are logically organized, so I recommend going through them first in order, rather than skipping around.)

The problem with the display could also be something we ran up against at work decades ago [1], and after wasting a lot of time, we got a some information from an applications engineer that fixed our problem, information that is continually lacking on these hobby websites.  I put LCD source code, in several forms, at http://wilsonminesco.com/6502primer/LCDcode.asm .  A reliable reset and setup requires writing the function set three times as shown there; and if you don't do that, you can sometimes get problems like you're talking about.

Oh, and about Jeff's reply above:  There are at least a couple of forum members with color blindness, and for at least one of them, if I understand him right, he cannot see the green against the yellow, and other colors are troublesome too.  It's best to always post the schematics in black & white.


[1] The controller IC used in these displays has been out for decades, and regardless of brand, the interface method is identical. How's that for stability?! :D

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 15, 2022 1:30 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8509
Location: Midwestern USA
Thanks, Jeff, for publishing the monochrome schematic.

I note two things that could be problem-causers:

  • Your reset circuit is insufficient for use with the WDC 65C02. The WDC C02’s reset input is not Schmitt-triggered—you will not get a clean reset with what you have. I suggest you use a Maxim DS1813 reset controller, or implement something like the reset circuit shown on Garth’s website.

  • SO on the MPU is floating. SO is an input and must be terminated, usually by being connected to VCC. Left floating, noise pickup on SO could cause the V bit in the status register to randomly set, triggering possible errors in sections of code that use the BVC or BVS instructions.

As the others noted, a system constructed on a solderless breadboard is often a hit-and-miss affair. Your unit could be wired exactly to design and still be unstable or DOA due to reactive effects associated with those long, curving wires. Also, with the bypass capacitors so far away from the chips, I doubt they are doing anything for you. That, and you need to get the oscillator a lot closer to everything so the signal that arrives at the chips has a vague resemblance to the signal leaving the oscillator.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 15, 2022 7:24 am 
Offline

Joined: Wed Dec 14, 2022 11:54 am
Posts: 4
Thanks for all the help everyone! :D I was worried it might be a wiring problem, but I guess I'll go triple-check everything again. I'll also make sure to tie that floating input to 5v.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 15, 2022 3:30 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
It might be a wiring problem, but I hope you've duly considered Garth's remarks re writing the function set three times... ie; a software problem. And have you no comment about the damage I mentioned to the LCD assembly?

Of course I can't know for certain what's going on, but to me it's entirely plausible that all your wiring is correct and the computer is working properly... but the message is becoming garbled after it is received by the LCD assembly. Garth's theory could explain this, as could mine.

If the problem is due to the mechanical damage, you'd need to either test the existing display in another computer, or (better yet) get a new display to test in the existing computer.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 15, 2022 4:32 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
Jeff, I think that might just be a photo artifact and not a drilled hole. Looks like maybe the backlight is bleeding? Doesn't mean that the LCD isn't the culprit, though! Maybe it's loose.

besser435, you're building a known-working design to run known-working code. That makes your troubleshooting easier, in a way. Either the problem is hardware failure - you've received some component that is defective (pretty unlikely, but not impossible) - or you made a mistake somewhere along the way (much more likely). It's hard to diagnose a mistake from a photo of a breadboard build that doesn't look much different from (actually, it looks nicer than many of) the literally hundreds of other photos of the same kit floating around on Reddit.

The experts who are telling you not to leave CMOS input pins floating and that you need more bypass capacitors are totally right; you should read those links and learn about parasitic capacitance. What's more, it's an easy fix. Adding a bypass cap and a ground return loop to each chip will probably take less than 5 minutes. It might even fix your problem! But I doubt it; Ben's kits usually work in spite of cutting some corners on best practices.

What kind of troubleshooting have you already done? Do you have a digital multimeter? I use this one:

https://www.amazon.com/ANENG-AN8008-Mul ... B076GZK62B

It is not too expensive, and is adequate for a hobbyist. It has a square-wave sense mode, so you can use it to check of your oscillator is working. (It won't tell you how clean your clock signal is, though.) What about the Arduino bus monitor; do you have that? Did you buy a commercial EEPROM programmer, or did you build one? (Or did the EEPROM come pre-programmed?)

I suspect that, since you don't have the clock module, that you've jumped straight into building the final kit, without building along with the videos, step-by-step. I think that might not be the best approach. I'm going to suggest you take a short break from your breadboard 6502 and build a clock module. Not necessarily the one in Ben's kit (read the Primer page on clocking the 6502 for more options) but a 555-timer circuit is an easy and cheap one to make. Take the trouble to really understand how it works! Engage with the circuit; try different resistor and capacitor values and see if you get the pulses you expect. Learn about the bistable and monostable modes of the 555-timer as well. If the output of your timer isn't symmetrical, do you know how to make it symmetrical? A plain 555-timer clock does drive the WDC 65C02, but it's technically not in spec (the rise/fall times are too slow). Do you know how to make them faster? The answer is in Ben's videos, but not always obvious, or delivered directly. (Hint: the secret to cleaning up your clock signal is disclosed in the PS/2 keyboard videos.)

Once you've armed yourself with better tools and better knowledge, you might just try rebuilding the whole kit, one step at a time, verifying as you go. If you take the "isolate and simplify" approach, when something does go wrong you'll have already eliminated many possible explanations. Of course, you should still re-check your previous steps. Just because your address bus was working last step doesn't mean that something hasn't come loose now! But if you know not just where each wire goes but *why* it goes there, what it's for, what it does when it's hooked up right, and what happens when it isn't, then each step will build your confidence and help focus your attention in the right direction when things don't work as expected.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 15, 2022 4:57 pm 
Offline

Joined: Wed Dec 14, 2022 11:54 am
Posts: 4
Paganini wrote:
Jeff, I think that might just be a photo artifact and not a drilled hole. Looks like maybe the backlight is bleeding? Doesn't mean that the LCD isn't the culprit, though! Maybe it's loose.

besser435, you're building a known-working design to run known-working code. That makes your troubleshooting easier, in a way. Either the problem is hardware failure - you've received some component that is defective (pretty unlikely, but not impossible) - or you made a mistake somewhere along the way (much more likely). It's hard to diagnose a mistake from a photo of a breadboard build that doesn't look much different from (actually, it looks nicer than many of) the literally hundreds of other photos of the same kit floating around on Reddit.

The experts who are telling you not to leave CMOS input pins floating and that you need more bypass capacitors are totally right; you should read those links and learn about parasitic capacitance. What's more, it's an easy fix. Adding a bypass cap and a ground return loop to each chip will probably take less than 5 minutes. It might even fix your problem! But I doubt it; Ben's kits usually work in spite of cutting some corners on best practices.

What kind of troubleshooting have you already done? Do you have a digital multimeter? I use this one:

https://www.amazon.com/ANENG-AN8008-Mul ... B076GZK62B

It is not too expensive, and is adequate for a hobbyist. It has a square-wave sense mode, so you can use it to check of your oscillator is working. (It won't tell you how clean your clock signal is, though.) What about the Arduino bus monitor; do you have that? Did you buy a commercial EEPROM programmer, or did you build one? (Or did the EEPROM come pre-programmed?)

I suspect that, since you don't have the clock module, that you've jumped straight into building the final kit, without building along with the videos, step-by-step. I think that might not be the best approach. I'm going to suggest you take a short break from your breadboard 6502 and build a clock module. Not necessarily the one in Ben's kit (read the Primer page on clocking the 6502 for more options) but a 555-timer circuit is an easy and cheap one to make. Take the trouble to really understand how it works! Engage with the circuit; try different resistor and capacitor values and see if you get the pulses you expect. Learn about the bistable and monostable modes of the 555-timer as well. If the output of your timer isn't symmetrical, do you know how to make it symmetrical? A plain 555-timer clock does drive the WDC 65C02, but it's technically not in spec (the rise/fall times are too slow). Do you know how to make them faster? The answer is in Ben's videos, but not always obvious, or delivered directly. (Hint: the secret to cleaning up your clock signal is disclosed in the PS/2 keyboard videos.)

Once you've armed yourself with better tools and better knowledge, you might just try rebuilding the whole kit, one step at a time, verifying as you go. If you take the "isolate and simplify" approach, when something does go wrong you'll have already eliminated many possible explanations. Of course, you should still re-check your previous steps. Just because your address bus was working last step doesn't mean that something hasn't come loose now! But if you know not just where each wire goes but *why* it goes there, what it's for, what it does when it's hooked up right, and what happens when it isn't, then each step will build your confidence and help focus your attention in the right direction when things don't work as expected.


Yeah, so I followed along with the videos and made sure all the connections lined up with the pinouts and the diagram. I probed all the points with the continuity setting on my multimeter and everything seemed to match up, but it's certainly possible I missed something. I did some more research, and I think at this point I might do some tinkering with other projects, then come back and rebuild this current setup as you suggested. I'll probably end up redoing the data and address lines, as I'm pretty confident in everything else. Thanks for the suggestions! :)


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 15, 2022 6:10 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Paganini wrote:
Jeff, I think that might just be a photo artifact and not a drilled hole.
Doh! -- of course. Now that you mention, I can easily imagine there's some sort of clear substance acting as a lens. Thanks.

Paganini wrote:
... a known-working design to run known-working code.
Design, yes. Code... maybe not so much. According to Garth, "a reliable reset and setup requires writing the function set three times as shown there; and if you don't do that, you can sometimes get problems like you're talking about."

I don't know whether Ben's code obeys this protocol, but I can believe it might not. I'm aware that others have successfully used his code. However, their success may be due to the controller in the LCD module being from a different manufacturer.

The fact that besser435's LCD produces any message at all tells me that the project is 95% working. Re the one remaining glitch, I tend to favor theories that pertain directly to the LCD, and I give less credence to theories about something like the address or data bus (which usually send the entire computer into the weeds).

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Thu Dec 15, 2022 9:00 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 15, 2022 7:49 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
Dr Jefyll wrote:
Paganini wrote:
Jeff, I think that might just be a photo artifact and not a drilled hole.
Doh! -- of course. Now that you mention, I can easily imagine there's some sort of clear substance acting as a lens. Thanks.


8)

Dr Jefyll wrote:
According to Garth, "a reliable reset and setup requires writing the function set three times as shown there; and if you don't do that, you can sometimes get problems like you're talking about."

I don't know whether Ben's code obeys this protocol, but I can believe it might not. I'm aware that others have successfully used his code. However, their success may be due to the controller in the LCD module being from a different manufacturer.

The fact that besser435's LCD produces any message at all tells me that the project is 95% working. Re the one remaining glitch, I tend to favor theories that pertain directly to the LCD, and I tend to give less credence to theories about something like the address or data bus (which usually send the entire computer into the weeds).


I think so too. If I remember correctly, Ben's code worked on Blue April but only at power up. The power up met the LCD module's setup requirements, but a system reset did not; so it would stop working after a reset. Using the full setup sequence Garth described along with some appropriately proportioned delay loops let me run Blue April at 8Mhz (instead of 1Mhz!) and also switch the LCD to 4-bit mode.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: DRG and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: