6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Jun 03, 2024 9:25 pm

All times are UTC




Post new topic Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Mon Jan 11, 2021 4:45 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
Krsultov wrote:
But, Why does this problem occur? I built the computer exactly how Ben did. He didn't have this problem.

Well, no you didn't. That's a hard lesson to learn, but an essential one. (It may be easier to learn if you've worked in software and had to deal with the, "But I didn't change anything!" cry from a user who really meant, "I didn't mean to change anything," or from another developer who really meant, "I didn't mean to change that!")

The first thing to understand here is that "digital" electronics are still very analogue, and thus are affected by all sorts of environmental factors (the current temperature and humidity in the room, the RF environment around you, grounding considerations), parts variances/tolerances assuming you are using the exact same part from the exact same production run, more variances/tolerances if you're using the exact same part from a different production run, and relatively huge differences if you're using different parts, such as a different maker of peripheral chip or breadboard.

This is why you're having problems with your reset circuit here, when the last time I put a 6502 on a breadboard I was using a much worse part (an NMOS CPU of dubious origin that was probably pulled from e-waste), probably a lower quality breadboard, and not even a switch, yet I was getting successful resets by just touching a wire to the reset pin (which had a resistor pulling it high when I wasn't grounding it).

The way all these variances are handled in production of electronic devices is to use careful, very conservative design that takes into account all the things that could cause problems and mitigates them. Sadly, wiring things together on a breadboard is pretty much the opposite of this approach: it's doing things that just invite problems in less-than-perfect environments.

I don't want to discourage you with all of this: nothing that you're experiencing is unfixable and, as you've no doubt seen, many others have built pretty much this same project and (at least eventually) got it working just fine. But the the particular problems you're seeing here are representative of the kinds of classic problems you'll be seeing when doing any hardware design of this sort, so if you expect that this is a one-off thing, you're in for some disappointment. It's simply not possible to have the same kind of consistency in environment for hardware that one can have in software. (And anybody experienced with software already knows that even there, reproducing fairly consistent environments is a challenge. Huge projects such as NPM, involving tens of thousands of programmer-hours, are devoted just to this.)

Quote:
Is there an easy way to fix the problem without adding any parts? Just rewire something?

Well, adding and changing parts is one of the basic techniques in hardware design, so if you want to avoid that and just want a working board for which you can start writing software, it might make more sense to go with a single-board-computer based on a printed circuit board (which will work much more reliably than a breadboard!) and that uses a more robust design (e.g., has a proper reset circuit).

To get this project working reliably you may have to buy a few more parts, but eventually you'll build up a stash of the more common ones that you'll constantly be using as you twiddle with hardware projects. That's just the nature of rolling your own systems at this level.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 12, 2021 3:45 am 
Offline

Joined: Wed Feb 23, 2005 5:44 pm
Posts: 42
Location: Sweden JO65kv
Make this to work is not rocket science. The fact that it sometimes works tells that it's likely correctly wired, but someting is marginal. The single display line with dark squares is typical for a non initialized 44780 and tells that the display module likely works. The need for power cycling to make it work also suggests it has to do with display initialization, as that's the only way to restart that process.

Those displays needs a power up sequence with some critical timing. Put back a little capacitor at the reset. Hold reset button closed when connecting power and then release it. Any result?

The processor must have ALL inputs. connected. Floating inputs gives unpredictable and variable results. If You don't knows how to connect them, then ask.

What oscillator frequency does You use? Do You have any slower available to try with, or f.ex. a 74??74 to bring it down?

Those Chinese LCD's on-chip oscillators has huge tolerances. Do You have any other display available to try with? Preferrably from a different manufacturer.

Do You have a logic pen? if not, get one. The E input of the display shall receive a pulse burst after every reset. Set the pen in pule stretch mode so it can indicate short events. Test PHI2 and random pins on the processor with the pen, are there activity?

Measuring f.ex. the address bus with a DMM will give different readings depending on the lines on/off ratio if rhe processor is running. A steady 0/5V on everything means something is bad.

Is the power good enough? That means not looking like a barb wire on a scope, 5.087454V on a DMM only tells the ADC is sensing that mean voltage.

Edit: Sorry, I was talking BS a little bit. Has always been using the little more complex, timed init procedure. Whith a clean power on and <10ms rise time to 2.7V a simplified init may be used. The complex init is guaranteed to work even with a slow or rough turn on. Without more info about the actual implementation it's impossible to know how it's done. The complex init will fail if run on a faster clock speed than it was designed for.
Maybe it can work better first applying mains power and then turn on with a switch on the +5V.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 12, 2021 8:46 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10821
Location: England
Some good thoughts! (Although, when you are an expert, things are more obvious and sometimes more easy. When a beginner, it may indeed seem like rocket science.)

Another thought: reflect on your time vs money tradeoff, which is a personal thing. If you have time, then you can get a diagnosis by patient investigation and analysis. If you have money, you could (for example) buy a replacement LCD display, perhaps a different one, but not too different, and that might work better.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 12, 2021 9:18 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
BigEd wrote:
...reflect on your time vs money tradeoff, which is a personal thing.... If you have money, you could (for example) buy a replacement LCD display....

Another option: if you have money and feel that you are serious about hardware hacking, an oscilloscope (though generally not one of the $30 digital ones!) is an excellent investment. Being able actually to see the waveforms in systems like this not only makes debugging significantly easier but will greatly increase the speed at which you learn.

Buying a 'scope comes with its own time/money tradeoffs. If you have $400 or so to spend, you can just grab any of one of the popular low-end 'scopes, along the lines of the classic Regol DS1054Z, and you'll be fine. If you want to spend signifciantly less, and more time on research, a used 20 MHz analogue 'scope (from Ebay or wherever) will usually do the trick and can be had sometimes as low as tens of dollars (plus probably a fair penny for shipping). Handheld and similar 'scopes can be ok, but it requires some work to find one that doesn't have limitations that range from annoying to crippling.

That said, a 'scope is by no means essential to fixing this sort of thing: a multimeter and a logic probe can take you a long way, if you're willing to put in the time.

Again, it all comes back to where you see yourself trying to go with this. Is your interest really in building and debugging hardware, which at the least is going to require starting to buy more parts, or are you just looking to have a reliably working 6502 microcomputer, in which case going with a pre-built SBC or a retrocomputer or something like that might be a better route to take?

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 12, 2021 9:48 am 
Offline

Joined: Sun Jan 03, 2021 7:22 pm
Posts: 13
Druzyek wrote:
What are the other chips you have in the circuit? If any of them require 5v, you might want to check the voltage at the power pin of each chip and the LCD individually. Depending on the breadboard and wires you're using, it could be dropping significant voltage, though it looks like you're using the breadboards that Ben Eater recommends


I have a logic gate, RAM, ROM, W65C22 VIA and a crystal oscillator - I checked - every chip has 5.37v on its VDD pin.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 12, 2021 9:55 am 
Offline

Joined: Sun Jan 03, 2021 7:22 pm
Posts: 13
cjs wrote:
BigEd wrote:
...reflect on your time vs money tradeoff, which is a personal thing.... If you have money, you could (for example) buy a replacement LCD display....

Another option: if you have money and feel that you are serious about hardware hacking, an oscilloscope (though generally not one of the $30 digital ones!) is an excellent investment. Being able actually to see the waveforms in systems like this not only makes debugging significantly easier but will greatly increase the speed at which you learn.

Buying a 'scope comes with its own time/money tradeoffs. If you have $400 or so to spend, you can just grab any of one of the popular low-end 'scopes, along the lines of the classic Regol DS1054Z, and you'll be fine. If you want to spend signifciantly less, and more time on research, a used 20 MHz analogue 'scope (from Ebay or wherever) will usually do the trick and can be had sometimes as low as tens of dollars (plus probably a fair penny for shipping). Handheld and similar 'scopes can be ok, but it requires some work to find one that doesn't have limitations that range from annoying to crippling.

That said, a 'scope is by no means essential to fixing this sort of thing: a multimeter and a logic probe can take you a long way, if you're willing to put in the time.

Again, it all comes back to where you see yourself trying to go with this. Is your interest really in building and debugging hardware, which at the least is going to require starting to buy more parts, or are you just looking to have a reliably working 6502 microcomputer, in which case going with a pre-built SBC or a retrocomputer or something like that might be a better route to take?



I know that an oscilloscope will be really nice I will eventually buy one :D, but I want to make project this as cheap as possible.

I will try to make an really simple oscilloscope with an arduino and a display, so I can just see what is happening with the Reset signal, address lines, datalines etc.

I also have a UT33D Uni-t multimeter, which I am sure will help :wink: .


About the logic probe - I will try to find one.

I also tested the LCD with an arduino and there is no problem.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 12, 2021 12:40 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
Krsultov wrote:
I know that an oscilloscope will be really nice I will eventually buy one :D, but I want to make project this as cheap as possible.

Well, that is really going about things the hard way, and is likely to lead to a lot of frustration for you. Making things cheaply can be done only when you know what corners you can cut, and you have neither the knowledge nor the tools to be able to do that right now. A decent 'scope will help immensely in gaining that knowledge.

Quote:
I will try to make an really simple oscilloscope with an arduino and a display, so I can just see what is happening with the Reset signal, address lines, datalines etc.

That won't be a 'scope, that will be a logic analyzer, and therein lies the problem: a logic analyzer is specifically designed to hide and be subject to the same kinds of problems you're probably seeing with your reset line right now. (A logic analyzer, or anything with a digital input, takes an analogue waveform and interprets it as a digital signal. If the analogue waveform is borderline, is it interpreting it in the same way as something else, such as the CPU, is? Almost certainly not.)

You have an problem that's almost certainly in the analogue domain, and digitial tools won't help there unless you're already intimately familiar with the analogue domain and why what your digital tools are showing you is not actually what's happening.

If you're certain that you're going to buy a 'scope at some point anyway, buy one now and use it to watch carefully exactly what's going on with the reset, clock and a few other important lines in the system. (And do remember that the 'scope, too, is not actually showing you what's really happening! But it's going to be a lot closer, and need a lot less interpretation, than digital probes.)

Quote:
I also tested the LCD with an arduino and there is no problem.

That would be pretty much exactly what I would expect if your problem is in the analogue domain.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 12, 2021 2:06 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3363
Location: Ontario, Canada
Krsultov wrote:
I checked - every chip has 5.37v on its VDD pin.
It will be good to also check that every chip has zero volts on its VSS pin.

And there are other pins which we know should be 0, or know should be 5 volts (SO and BE, for example). Check those, too!

Have fun, and keep in touch! :)

-- 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: Tue Jan 12, 2021 6:54 pm 
Offline
User avatar

Joined: Mon May 12, 2014 6:18 pm
Posts: 365
Quote:
Handheld and similar 'scopes can be ok, but it requires some work to find one that doesn't have limitations that range from annoying to crippling.
I got one of these which seems pretty good: https://www.amazon.com/Hantek-Oscillosc ... 401&sr=8-3

Here's a review of the 70MHz version that may be useful: https://hackaday.com/2020/06/28/hantek-3-in-1-instrument-reviewed/


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 12, 2021 9:17 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8198
Location: Midwestern USA
Krsultov wrote:
About the logic probe - I will try to find one.

Logic probes are readily available from many sources. Or you could build one from scratch if you are so inclined. If you add your geographical location to your forum profile we can offer suggestions on possible sources—which don't necessarily include eBay vendors.

I've debugged minicomputer hardware with nothing more than a good logic probe. In fact, my first homebrew computer, POC V1.0, was partially DOA when first powered, and was debugged with just a logic probe and reference to the schematic and memory map. That said, a quality 'scope is a worthwhile addition to your test equipment, especially if you have designed something that runs at higher clock rates but is not working right. A logic probe can tell you the state of a circuit (low or high) and if it is stable or pulsing. However, it can't tell you about signal quality and timing.

cjs wrote:
Quote:
I know that an oscilloscope will be really nice I will eventually buy one :D, but I want to make project this as cheap as possible.

Well, that is really going about things the hard way, and is likely to lead to a lot of frustration for you. Making things cheaply can be done only when you know what corners you can cut, and you have neither the knowledge nor the tools to be able to do that right now. A decent 'scope will help immensely in gaining that knowledge.

Curt is right. If you are going to get satisfaction from the homebrew computer hobby you have to be willing to invest in decent test gear. Even experienced builders will run into hardware hassles with new designs. When they do they reach for the logic probe and 'scope to figure out the problems.

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 13, 2021 12:22 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
Druzyek wrote:
Quote:
Handheld and similar 'scopes can be ok, but it requires some work to find one that doesn't have limitations that range from annoying to crippling.
I got one of these which seems pretty good: https://www.amazon.com/Hantek-Oscillosc ... 401&sr=8-3

Yeah, I have one of those and that's my benchmark for "merely annoying limitations," as opposed to crippling. It's worth including in your research, but here's my summary as an owner:

  • It's not cheap: by the time you buy a second probe even the 50 MHz version is around half the price of a modern benchtop 4-channel 'scope, and much more expensive than an old analogue 'scope.
  • Not only is the UI a pain compared to a benchtop 'scope, it's significantly less capable, particularly when it comes to triggering and measurement. (I'm not sure how much less capable it is than an old, fairly simple analogue 'scope, but it's also less capable than a good professional 1980s analogue 'scope.)
  • The multimeter is ok, but if a dedicated multimeter is available, I always grab that instead.
  • The feature that makes this at all worthwhile is the portability. I bought it for meetups, but even for that use case if I can manage to make enough room for my Rigol, I bring that instead. (About one out of three retrocomputing meetups.)

All that said, if the Hantek is right at the edge of your budget, it's still going to be a lot better than just a logic probe.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 13, 2021 6:08 am 
Offline

Joined: Wed Feb 23, 2005 5:44 pm
Posts: 42
Location: Sweden JO65kv
Don't let this very minor problem drift away. Here in Sweden we hava a saying "to make a hen out of a feather"...

You most likely have a bad reset. to be good it must be one clean transition and not came too early.

The reasons for that are the display's intermal reset functions that take some time (a few tenths of milliseconds) and must be completed before Your computer starts to send it commands. Those commands also need to be consistent and not cut off at arbitrary times and repeated by a bouncy reset. That meshes up command and data the display receives. The processor itself also requires a couple of clean clocks before release of the reset.

Have You yet tried to hold reset button down whilest power is applied? Capacitor on reset is required.

Did You buy the display from Mr Eater so it's approved to work reliable with the software? I know nothing about him, is it a cut-and-try guy, or a proper designer reading datasheets and accounts for worst case conditions? There are, as said before, huge tolerances in the display's internal timing.

Do You have a W65C22S VIA? If its a ..22N or any NOS chip the IRQ line must have a pull-up resistor.


At least order a logic pen ASAP, it's an indispensible tool when experimenting with microprocessors like tha 65*. It's much more useful than a toy $29 single card "scope".

If You decide to buy a real scope, delayed timebase is a must. Without it detailed observations a little longer after the trig event will become impossible. Such situations are very common during hardware debugging.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 13, 2021 10:45 am 
Offline

Joined: Sun Jan 03, 2021 7:22 pm
Posts: 13
I live in Bulgaria.

I have tried to hold the button, but still no change. Installed a pull-up resistor on the IRQ pin - no change. Measured all voltages - all OK.

Is this oscilloscopehttps://www.aliexpress.com/item/32973233356.html Going to help?.

I also noticed Ben doesn't have a capacitor on the reset switch or a resistor on the IRQ pin.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 13, 2021 12:00 pm 
Offline

Joined: Wed Feb 23, 2005 5:44 pm
Posts: 42
Location: Sweden JO65kv
That is a toy, not a scope. Not recommended. With it's low sampling rate it will just show interferences between that and the signal You try to measure. In short, 100% pure crap.

Ali has locic probes, I have no idea about performance or build quality. F.ex. the one below. Just search logic probe. Unfortunately there comes up lots of cables and other "noise", but look it through and You will find.

https://www.aliexpress.com/item/3299019 ... web201603_

The schematic at the Ben Eater site has the reset capacitor.
The IRQ pull-up is not needed on WDC's 6522S VIA's as it has CMOS IRQ output. Their 6522N. or any old chip, has an open drain output that only can sink current and threfore needs the pull-up. Advantage is, many devices can be just paralleled, but don't let such stuff distract right now.

Have You tried to start the power supply first and close the +5V commection after the mains voltage has been applied? If the voltage ramps up too slow it might affect the display's power on reset circuits.

What is the software intended to do? I saw there are some buttons connected in the schematics. Are everyting around the pin's intended for those in order? Otherwise strange and unexpected things may happen, depending on the flash software. The shematic shows pull-ups. Are the floating and used by the program, there will be an issue.


Attachments:
bene_reset.png
bene_reset.png [ 11.87 KiB | Viewed 597 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 13, 2021 12:42 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10821
Location: England
I don't know if this will help: building a computer from chips isn't like LEGO, it's more like building a model plane. Two things might be connected, but they might not be connected well enough. Each component might not be quite as it needs to be. So, the Ben Eater project, great though it is for explanation and accessibility, shouldn't be thought of as a matter of assembling things together - there's more craft to it than that. Some people will be lucky, and have complete and immediate success. Actually, they will miss out on some learning opportunities. Others will find, as we see here, that there's some debugging to be done. It might be the components, or the assembly, or the surrounding equipment such as the power supply. It might even be the external temperature, if that's extreme.

So, ideally, you approach this not as a matter of putting together a kit, but as a first experience in a hobby of retro electronics. I hope you do, and you stick with it.

The other thing is, it's always tempting when looking at something which isn't working to go around it pointing at things and saying that each one is fine, and is as it should be. A better approach is to go around pointing at things and asking what might not be fine. Every connection, every end of every wire: does it go where it should? Are there errors in transcription or in understanding? Be thorough, and be prepared to doubt everything.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 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: