Single 6522 for a few applications
Re: Single 6522 for a few applications
Chad,
In a well-behaved hardware, you can change the voltage +/- 10%, speed up 10%, probe around with un-compensated 100pF load and everything will continue to work normally. When we design new hardware, we frequently build qualification units that got beat up with voltage/temperature/overclock/shock/vibration to establish its design margin. Your hardware, unfortunately, is not well behaved. It is marginal because something is barely working. This is where voltage/temperature/operating frequency become important, not as a permanent fix, but as a diagnostic tool to find out what's lacking. So if you do lower the voltage and thing start to work better, than it is a system noise problem. If it works better with higher voltage, it is a performance issue. If you place a 100pF probe (that's the loading of an uncompensated scope probe) at certain spot and it start to fail or start to work, it is an important clue of what's wrong, not a solution (despite of the common joke about shipping a board with a probe attached). Another source of mis-behaving hardware is mechanical intermittency, such as loose conductive particles, bad solder joints, or bad socket. If a design is already proven but a particular instantiation is faulty, I'll bet against heavy odd it is a mechanical intermittency, but your design is not proven, so we need to cast a wide net trying to understand the nature of the problem, not to fix it necessary, but to cut the problem set in half and then half it again until we zero in to the specific issue.
Welcome to debugging!
Bill
In a well-behaved hardware, you can change the voltage +/- 10%, speed up 10%, probe around with un-compensated 100pF load and everything will continue to work normally. When we design new hardware, we frequently build qualification units that got beat up with voltage/temperature/overclock/shock/vibration to establish its design margin. Your hardware, unfortunately, is not well behaved. It is marginal because something is barely working. This is where voltage/temperature/operating frequency become important, not as a permanent fix, but as a diagnostic tool to find out what's lacking. So if you do lower the voltage and thing start to work better, than it is a system noise problem. If it works better with higher voltage, it is a performance issue. If you place a 100pF probe (that's the loading of an uncompensated scope probe) at certain spot and it start to fail or start to work, it is an important clue of what's wrong, not a solution (despite of the common joke about shipping a board with a probe attached). Another source of mis-behaving hardware is mechanical intermittency, such as loose conductive particles, bad solder joints, or bad socket. If a design is already proven but a particular instantiation is faulty, I'll bet against heavy odd it is a mechanical intermittency, but your design is not proven, so we need to cast a wide net trying to understand the nature of the problem, not to fix it necessary, but to cut the problem set in half and then half it again until we zero in to the specific issue.
Welcome to debugging!
Bill
Re: Single 6522 for a few applications
Further to what what plasmo and BDD said, remember also to consider the issues listed in Ed's post.
As for some proper scope probes, is there any chance the college could lend you those, too? It seems highly likely they would've had a set when the scope was new.
-- Jeff
As for some proper scope probes, is there any chance the college could lend you those, too? It seems highly likely they would've had a set when the scope was new.
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Single 6522 for a few applications
Thank you BDD.
I don't have a lot of extra parts on hand (I'm still new to all of this), and I don't have a ton of money for good testing equipment. But I do have this LM1117 at home from another project, and I have a bit of time until some more capacitors come in.
I think I read that the 28c256 will not WRITE at 3.7V less (or some such), but I heard someone online powering it with a Raspberry Pi's 3.3V so that the output doesn't blow up the GPIO pins when you READ it. Idk.
As with any human, I will only have so much patience with "trying stuff" before I move on entirely, i.e. a printed board.
Thank you.
I don't have a lot of extra parts on hand (I'm still new to all of this), and I don't have a ton of money for good testing equipment. But I do have this LM1117 at home from another project, and I have a bit of time until some more capacitors come in.
I think I read that the 28c256 will not WRITE at 3.7V less (or some such), but I heard someone online powering it with a Raspberry Pi's 3.3V so that the output doesn't blow up the GPIO pins when you READ it. Idk.
As with any human, I will only have so much patience with "trying stuff" before I move on entirely, i.e. a printed board.
Thank you.
Re: Single 6522 for a few applications
Dr Jefyll wrote:
Further to what what plasmo and BDD said, remember also to consider the issues listed in Ed's post.
As for some proper scope probes, is there any chance the college could lend you those, too? It seems highly likely they would've had a set when the scope was new.
-- Jeff
As for some proper scope probes, is there any chance the college could lend you those, too? It seems highly likely they would've had a set when the scope was new.
-- Jeff
For that list:
When you have an unreliable self-built computer, there are several possibilities
- error in the circuit design (glue logic or clock logic is not safe)
*** If it works sometimes, but not every time, it could still be this, but I wouldn't know why. ***
- error in the construction of the circuit (you built something different than you intended to)
*** Again, if it works sometimes, I don't know what could be "wrong" in any logic sense. Maybe I just don't understand. ***
- poor quality in the construction of the circuit (dry joints, bad connectors)
*** Definitely. Tons of grime and whatnot, and I cannot reach anything. ***
- poor power supply quality (not enough bypass capacitors, too much resistance)
*** Capacitors could be the issue, I'm working on that. The USB charger pumps 1.5A and that LCD screen LIGHTS up (when it was still plugged in). ***
- bad component (perhaps damaged by static, or not the component it's labelled as)
*** Yes again. As I was messing around, I saw sparks a couple of times. I theorize my DS1813 might have got the bad end of that deal, as my reset button just WON'T work sometimes. ***
Thank you for reminding me.
Re: Single 6522 for a few applications
plasmo wrote:
Welcome to debugging!
I have been trying all kinds of weird things. I don't want to list them all here, but I am in that process.
Maybe you or someone else could answer me this question/thought:
When I program (in C++ lets say), I can compile/test every new line of code if I want to. Certainly each new method or whatever. I compile a LOT. Like, I would have been kicked out of the Fortran mainframe room for printing so many times [ we had a limit of 3, very tough on my heart ].
I cannot do that here. It's an all-at-once kind of thing. Before I put the chips in, I tested tested those sockets, checked everything I could along the way to see if stuff was touching or whatever. I quadruple checked which wires went where. I got the flashlight out often. But for all of that, I still can't compile/test the darn thing until I stick those chips in. It either works, or it doesn't.
So how do you guys compile/test hardware? How can I check if something makes sense without plugging in every-single-little-chip? Sure I can plug in a clock and see "oh it's going up and down, yay", but the 6502 requires RAM and ROM, which requires glue logic, which requires, etc etc, etc.
Anyways, thank you. Sorry if that was a rant, I wasn't intending for it to be.
Chad
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Single 6522 for a few applications
sburrow wrote:
I think I read that the 28c256 will not WRITE at 3.7V less (or some such), but I heard someone online powering it with a Raspberry Pi's 3.3V so that the output doesn't blow up the GPIO pins when you READ it. Idk.
I have data sheets for the 28C256 from two different manufacturers, and both say 5 volts ±10 percent.
Quote:
As with any human, I will only have so much patience with "trying stuff" before I move on entirely, i.e. a printed board.
I hear yuh! I have nearly infinite patience with machines, key word being “nearly.” I've scrapped several builds when I couldn't solve issues in a reasonable amount of time—my time has gotten too valuable (due to being an old codger) to expend a lot of it on something that is just plain obdurate. In other words, one has to know when it's time to stop beating a lame horse.
When I designed my first POC unit, I went with a four-layer PCB and never even considered a hand-wired build. Assuming a proper PCB layout, the only “wiring errors” one is likely to make are inserting parts backwards or putting the wrong parts into the wrong locations. That alone drastically decreases the likely of a DOA unit.
One of my goals with the POC design was to be able to run at 8 MHz or better. I wasn't confident I could build a hand-wired unit well enough to reach that goal (BTW, POC V1.0 was able to run at 12.5 MHz, and that was with some bodge wiring to fix a glue logic error). Four-layer PCBs were still fairly expensive back then, but costs have plummeted in the last 10 years. No reason to not take advantage of that.
A properly laid-out, four-layer PCB will exhibit much lower noise than anything you can hand-wire, and will be easier to design than a two-layer board (no routing of VCC and ground with four layers). With the ground and power layers separating the signal layers from each other, cross-talk and mutual inductance problems in coincidental traces are eliminated. Plus ground bounce is greatly reduced. Furthermore, the capacitance that will exist between the power and ground layers will do a good job of soaking up noise. It's a win-win by any measure.
Quote:
I cannot do that here. It's an all-at-once kind of thing.
Welcome to the world of bare-metal programming. It's an acquired skill, so don't despair.
Quote:
So how do you guys compile/test hardware?
To be pedantic, one “assembles” assembly language, not “compiles” it.
When I bring up a new design for the first time, I reach for two things: my clock single-stepper and an EPROM that is nothing but a bunch of NOP instructions. I install the EPROM and a 1 MHz clock oscillator and using a logic probe, watch the address and data lines for signs of life. If I see activity on the buses, it means the MPU is alive and apparently well.
Next, I use a ROM that can do minimal I/O, just enough to blink some LEDs hooked up to various circuit points, or enough to drive a serial I/O connection to which I can attach some sort of display device. If that works, then I can move on to a more elaborate ROM—at that point, it becomes a programming project.
If the beast isn't doing what I expect it to do, I replace the oscillator with the single-stepper and "walk" the MPU through the reset cycle, while observing the address bus and then the data bus for the correct bit patterns. This is practical with the WDC MPUs because they have static cores and thus may be halted without detriment by stopping the clock in either phase. The single-stepping process will almost always identify any problems in the design, such a glue logic error or burning code into the wrong part of ROM.
It takes a certain amount of practice and experience to get the hang of it, but once you have, it'll become second nature and each build will get easier.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Single 6522 for a few applications
BigDumbDinosaur wrote:
It's a win-win by any measure.
1) You sold me on the 4-layer board. I'll be looking into that very shortly.
2) Your NOP ROM and single-step in place of oscillator are awesome ideas.
3) You are 100% correct about time. On my end, I've got 2 young kids and they need attention too.
So, I tried the 3.3V and... I thought it was working perfectly! I had the scope reading exactly as I was hoping, ah great! So I solder a few things, trying to piece something together. Did all this work, try it again and... not working. Nope, actually the scope was throwing me off! It was deceiving me bigtime. Multimeter says what's really going on, and that scope is backwards and just plain wrong in this case.
Idk if the 28C256 was working or not, I just know that I wasn't getting anything as expected.
I don't know if I will even bother with those in-coming capacitors, we will see. The 4-layer board is the way to go here, considering time as well.
Thank you BDD, and everyone. At least I got this one to work... sometimes. [ And that EEPROM programmer is beautiful. ]
Chad
Re: Single 6522 for a few applications
sburrow wrote:
For that list:
When you have an unreliable self-built computer, there are several possibilities
- error in the circuit design (glue logic or clock logic is not safe)
*** If it works sometimes, but not every time, it could still be this, but I wouldn't know why. ***
- error in the construction of the circuit (you built something different than you intended to)
*** Again, if it works sometimes, I don't know what could be "wrong"
When you have an unreliable self-built computer, there are several possibilities
- error in the circuit design (glue logic or clock logic is not safe)
*** If it works sometimes, but not every time, it could still be this, but I wouldn't know why. ***
- error in the construction of the circuit (you built something different than you intended to)
*** Again, if it works sometimes, I don't know what could be "wrong"
I get that you probably had two distinctly different behaviors, and that one of them seemed plainly wrong. But what about the other behavior? (I apologize if you did get a good, solid opportunity to verify program execution. If you mentioned that I missed it.)
My point is, don't be too quick to rule out any of the points Ed made. Troubleshooting involves some subtle skills, and it's not unusual to hear novices say, "It can't be [blah-blah] because [whatever]." One of the subtle skills is doubting yourself -- questioning assumptions and looking for things you may've missed.
Have fun, and keep us posted!
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Single 6522 for a few applications
sburrow wrote:
Nope, actually the scope was throwing me off! It was deceiving me bigtime. Multimeter says what's really going on, and that scope is backwards and just plain wrong in this case.
In a situation such as what you are experiencing, I tend to do most of my troubleshooting with a logic probe. Digital circuits are inherently simple, as they ideally have two states: on or off, high or low, 1 or 0. Anything else is wrong, where “wrong” implies the circuit isn't doing what it should.
A good logic probe will show which state a circuit is in, plus will have a third indication that will flash if the circuit is undergoing transition. In years past, I did troubleshooting on minicomputer hardware using just a logic probe and an understanding of how the circuit is supposed to work. You really should invest in one—probe, that is, not a minicomputer.
As for use of a multimeter, the best it can do is indicate the voltage level of the circuit. Even that may be suspect due to the meter loading the circuit under test. The meter will not tell you if a circuit is undergoing transition and in fact, will likely be much too slow to reliably detect such a thing.
Dr Jefyll wrote:
Troubleshooting involves some subtle skills, and it's not unusual to hear novices say, "It can't be [blah-blah] because [whatever]."
Yep! Blind assumptions will often lead you down a rabbit hole. Just like a pilot flying in zero visibility, you need to trust your instruments (test gear). Intuition also matters, but intuition is borne of troubleshooting experience. For now, look at all possibilities and don't rule any of them out until you can positively support doing so. You are engaged in one of the most difficult of troubleshooting tasks: figuring out why a brand new design isn't working.
x86? We ain't got no x86. We don't NEED no stinking x86!
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Single 6522 for a few applications
One more thing, as Columbo would say...
Pick one set of test conditions—voltage, etc., and stick with them. If you keep moving the goal posts you will never score.
Pick one set of test conditions—voltage, etc., and stick with them. If you keep moving the goal posts you will never score.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Single 6522 for a few applications
An update on this board:
Bill (plasmo) asked if he could look over the board and test it. I sent it to him, and he found that I had flipped A4 and A11 on the RAM and ROM. If you look at the datasheet, they are right across from one another. I was not careful enough when moving wires from the 6502 downwards.
When Bill flipped those, it worked! That was literally the only thing wrong with it! So why was it only working... sometimes? I don't know, but it works now thanks to Bill. Thank you so much Bill!
Attached are some pictures and a short GIF video. Bill added some LED's to the front, you can see his thin blue wires compared to the fat wires I used.
Well, I learned a LOT from this. Even though my solder work was ok, my wires were crossed! I will be extra careful next time, as well as knowing more how to debug.
As you might know I already have a 4-layer board coming in (eventually), but in the meantime I will be coding this guy. It'd be cool if it can calculate "pi". [ That was going to be my first demo software. ] I'm likewise going to showcase this at the upcoming Math Appreciation Day at the college in the Spring.
Thank you all for your help on this, and thank you again Bill for your kindness to me.
Chad
Bill (plasmo) asked if he could look over the board and test it. I sent it to him, and he found that I had flipped A4 and A11 on the RAM and ROM. If you look at the datasheet, they are right across from one another. I was not careful enough when moving wires from the 6502 downwards.
When Bill flipped those, it worked! That was literally the only thing wrong with it! So why was it only working... sometimes? I don't know, but it works now thanks to Bill. Thank you so much Bill!
Attached are some pictures and a short GIF video. Bill added some LED's to the front, you can see his thin blue wires compared to the fat wires I used.
Well, I learned a LOT from this. Even though my solder work was ok, my wires were crossed! I will be extra careful next time, as well as knowing more how to debug.
As you might know I already have a 4-layer board coming in (eventually), but in the meantime I will be coding this guy. It'd be cool if it can calculate "pi". [ That was going to be my first demo software. ] I'm likewise going to showcase this at the upcoming Math Appreciation Day at the college in the Spring.
Thank you all for your help on this, and thank you again Bill for your kindness to me.
Chad
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Single 6522 for a few applications
sburrow wrote:
Bill (plasmo) asked if he could look over the board and test it. I sent it to him, and he found that I had flipped A4 and A11 on the RAM and ROM.
Amazing what some mixed-up wires can do to you.
x86? We ain't got no x86. We don't NEED no stinking x86!