6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Apr 29, 2024 7:41 am

All times are UTC




Post new topic Reply to topic  [ 163 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11
Author Message
PostPosted: Tue Nov 09, 2021 8:31 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1076
Location: Albuquerque NM USA
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 09, 2021 8:37 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3349
Location: Ontario, Canada
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

_________________
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 Nov 09, 2021 8:45 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 09, 2021 8:51 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
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


Nope to the probes. This thing was "acquired" from a dissolved dept after a merge (politics and stuff), and they are "off the books" according to the college, yet still "on the books" for my dept. Strange. They were also tossed into a cabinet years ago, and since then the building flooded and most of the equipment was damaged. I think this one survived, but we don't have any use these things anymore. That's why I was able to take it home!

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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 09, 2021 9:03 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
plasmo wrote:
Welcome to debugging!


True, and good info for sure. Thank you.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 09, 2021 9:32 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8155
Location: Midwestern USA
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. :D

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. :oops:

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!


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 10, 2021 12:09 am 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
BigDumbDinosaur wrote:
It's a win-win by any measure.


BDD, that was an excellent summary.

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 10, 2021 12:41 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3349
Location: Ontario, Canada
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"

How sure are we that "it works sometimes"? When troubleshooting, it's best to remain suspicious about one's conclusions, simply due to human nature and Murphy's Law. And perhaps the "works sometimes" conclusion is a little hasty.

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. :| :roll:

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 10, 2021 12:48 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8155
Location: Midwestern USA
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. :D

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!


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 10, 2021 12:50 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8155
Location: Midwestern USA
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.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 12, 2021 8:56 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
Version2 discussion has been moved to a new topic, located here:

viewtopic.php?f=12&t=6868


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 17, 2021 10:09 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
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


Attachments:
video.gif
video.gif [ 9.72 MiB | Viewed 6342 times ]
20211117_154032.jpg
20211117_154032.jpg [ 2.51 MiB | Viewed 6342 times ]
20211117_153936.jpg
20211117_153936.jpg [ 2.33 MiB | Viewed 6342 times ]
20211117_153934.jpg
20211117_153934.jpg [ 2.35 MiB | Viewed 6342 times ]
Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 18, 2021 12:37 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8155
Location: Midwestern USA
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. :D Hopefully, this will be a thing of the past when you start building on a PCB.

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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 163 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11

All times are UTC


Who is online

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