6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 7:26 pm

All times are UTC




Post new topic Reply to topic  [ 178 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 12  Next
Author Message
PostPosted: Mon Aug 07, 2023 4:20 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
sburrow wrote:
So, what do we know? We know that it works at 0.5 MHz and 4 MHz. It seems completely stable? Reliable? Good to go? Then we know it's not a concept design issue. You want it to go fast, that's your goal, so either it's timing margins or connections. It's something physical, essentially.
That's my conclusion as well. It's really hard to track down too (and totally possible that it's a combination of many small problems) because when you flex the board conditions might be changing far away from your contact point.
sburrow wrote:
If you have any questions at all, we can talk. Apparently I've been printing boards for a year and a half now, and loving every moment of it.
Thanks for that offer, Chad, I really appreciate it, and may just take you up on it. Just figuring out how to get started is daunting... I mean, there are an overwhelming number of PCB "how to" youtube videos. I don't even know where to start!

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


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 07, 2023 4:45 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
Hi George,

gfoot wrote:
That's a shame. Could you measure the clock signal at the CPU pin and check how stable that is? You could also measure the input to the counter and watch out for ringing etc. The other thing I was wondering was how good your ground network is - you have a lot of signal wires floating around there, what are the ground return paths like for those?
The clock signal looks good at the CPU... when it's there at all! At first I assumed that the problems I was having were related to frequency, but now I think that may just be a coincidence. It just so happens that my slower oscillators are FULL can and the faster ones are half can. In other words, the slow ones are heavier, have slightly thicker leads, and attach to the VCC network through a different socket pin. I feel about... 80% certain that the problem is mechanical, and I think it might be VCC related. An intermittent connection to VCC means the oscillator doesn't switch *at all,* which is behavior I sometimes observe. Meanwhile, other ICs may just act flaky, be powered through other pins, etc. Maybe jumpering unused inputs to VCC wasn't as good of an idea as I thought. (If the jumpers are bad, maybe they're acting like bouncy switches.)

There's some ringing / overshoot off of the `163 (more with AC than with HC) but not a scary amount. The ground network is a grid of bare wire on the component side of the board. It's a one square per IC resolution. I didn't have room on the board for wiring channels, so I had in mind that it would be sort of 3D. The signal wires would "hover" over the ground layer and as long as they go more or less directly from one IC to another there should be a reasonable corresponding return path. For the really long flying wires (like the test rig wires, and the off-board clock) I added a few ground return wires; the clock got its own twisted pair return wire. The bottom row of pins on the edge connector is all ground, so I just plugged in a couple here and there between the breadboards and the edge connector.

Quote:
Also, did you connect the fourth pin of the oscillator? Sometimes this is an "enable" pin. If it's floating maybe that's why it's erratic and likes having your finger there.
I didn't connect that pin; the 27MHz can I have is this one, which I think is one of the pin 1 = NC ones: https://www.digikey.com/en/products/det ... -EK/675389

Quote:
In terms of bus monitoring I highly recommend hoglet's decoder rather than the Arduino, it is easier to connect reliably and it can deal with much faster clock speeds. The cheap logic analyser I got seems to support sampling at up to 48MHz, enough for a CPU clock of up to about 8MHz I think, and I haven't tried synchronous capture but that might support even higher rates. Hoglet's decoder decodes the data stream into disassembled CPU instructions. You don't get the address bus, but it adds addresses when it's worked them out based on other instructions... very clever.
Ed recommended that to me a while ago as well; at the time it was beyond my means and my level of knowledge, I think. I should give it another look!

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


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 07, 2023 5:41 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Paganini wrote:
The clock signal looks good at the CPU... when it's there at all!

Oh so sometimes you don't see the clock signal at the CPU? At least there's something clear missing then!

Quote:
At first I assumed that the problems I was having were related to frequency, but now I think that may just be a coincidence. It just so happens that my slower oscillators are FULL can and the faster ones are half can. In other words, the slow ones are heavier, have slightly thicker leads, and attach to the VCC network through a different socket pin. I feel about... 80% certain that the problem is mechanical, and I think it might be VCC related. An intermittent connection to VCC means the oscillator doesn't switch *at all,* which is behavior I sometimes observe.

This might be a silly question, but you have checked that the smaller socket's VCC pin is actually providing power? You could also connect an oscilloscope to it set to trigger on an edge at e.g. 4V, and see if it ever triggers, to see whether you're getting an intermittent connection.

Quote:
The ground network is a grid of bare wire on the component side of the board. It's a one square per IC resolution.

Oh wow, that's very thorough. My breadboard ground grid is just the regular ground rails plus three or four "vertical" connections between each pair of adjacent rails.

Quote:
Quote:
Also, did you connect the fourth pin of the oscillator? Sometimes this is an "enable" pin. If it's floating maybe that's why it's erratic and likes having your finger there.
I didn't connect that pin; the 27MHz can I have is this one, which I think is one of the pin 1 = NC ones: https://www.digikey.com/en/products/det ... -EK/675389

Hmm, I always connect it just in case.

According to the datasheet though, that oscillator is for 3.3V operation, not 5V - is that definitely the part you're using?


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 07, 2023 6:54 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
gfoot wrote:
According to the datasheet though, that oscillator is for 3.3V operation, not 5V - is that definitely the part you're using?
Well sh**. :x I could have sworn I had applied the 5V filter to both my Mouser / Digikey searches. :oops:

That being said, the 25.175MHz oscillator I used to test is the one from the VGA circuit; it's definitely the right voltage, and it gives me the same kind of intermittent behavior.

Quote:
Paganini wrote:
The clock signal looks good at the CPU... when it's there at all!

Oh so sometimes you don't see the clock signal at the CPU? At least there's something clear missing then!
Sometimes I don't see it at the oscillator. :)

Quote:
This might be a silly question, but you have checked that the smaller socket's VCC pin is actually providing power? You could also connect an oscilloscope to it set to trigger on an edge at e.g. 4V, and see if it ever triggers, to see whether you're getting an intermittent connection.
I checked with my multimeter before populating the board that every ground pin and every VCC pin had continuity with ground and VCC. I also powered the board and checked for 5V between each socket's VCC and ground. Maybe connections that are good enough to satisfy my multimeter are not good enough to satisfy an IC? Also, I'm not sure my old analog scope can trigger on a specific voltage; if it can I don't know how to do it!

One thing, though, is that even when the oscillator is working and I get a clear clock I still get intermittent functionality. Right now I have the board sitting next to me with the 25.175MHz full can installed. I can see on the scope that the clock is working, and the stretcher is working (which means the RAM/ROM decode is working) but it's still only able to initialize the VIA if I apply pressure to the board.

Quote:
Quote:
The ground network is a grid of bare wire on the component side of the board. It's a one square per IC resolution.

Oh wow, that's very thorough. My breadboard ground grid is just the regular ground rails plus three or four "vertical" connections between each pair of adjacent rails.
I was inspired by one of Bill Herd's boards: https://hackaday.com/wp-content/uploads ... header.png And also by Jeff's inspirational lecture which proved to be the difference between working and not working for one of my earlier breadboard projects! :)

Quote:
Quote:
Quote:
Also, did you connect the fourth pin of the oscillator? Sometimes this is an "enable" pin. If it's floating maybe that's why it's erratic and likes having your finger there.
I didn't connect that pin; the 27MHz can I have is this one, which I think is one of the pin 1 = NC ones: https://www.digikey.com/en/products/det ... -EK/675389

Hmm, I always connect it just in case.
What do you connect it to? On the cans that have tri-state, are the enable signals always active high (or low)?

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 08, 2023 12:03 am 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
Paganini wrote:
What do you connect it to? On the cans that have tri-state, are the enable signals always active high (or low)?


I believe it is active-high, so you would connect it to 5V.

I have never connected mine in all of my projects, I have always left it NC. But I also have a solder jumper nearby on the board to connect it to 5V in case I buy an oscillator that actually does need it, for once.

Chad


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 08, 2023 11:55 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Paganini wrote:
Well sh**. :x I could have sworn I had applied the 5V filter to both my Mouser / Digikey searches. :oops:

If you can supply it with 3.3V then it should at least be able to drive TTL level ICs like HCT, ACT, etc, so may still be of use to you.

Quote:
I checked with my multimeter before populating the board that every ground pin and every VCC pin had continuity with ground and VCC. I also powered the board and checked for 5V between each socket's VCC and ground. Maybe connections that are good enough to satisfy my multimeter are not good enough to satisfy an IC? Also, I'm not sure my old analog scope can trigger on a specific voltage; if it can I don't know how to do it!

Yes analogue non-storage scopes aren't so good for diagnosing intermittent issues, as they only create a display briefly when the trigger condition is met, so they work best on consistently repeating signals.

Quote:
One thing, though, is that even when the oscillator is working and I get a clear clock I still get intermittent functionality. Right now I have the board sitting next to me with the 25.175MHz full can installed. I can see on the scope that the clock is working, and the stretcher is working (which means the RAM/ROM decode is working) but it's still only able to initialize the VIA if I apply pressure to the board.

I'd recheck the voltages in case there's some excessive load or a short somewhere, and get hold of a logic analyser to use with the decoder, I think it will give an insight into whether the cpu is executing the wrong instructions or the VIA is responding incorrectly.

It is not very hard to set up and the logic analyser is cheap, just a few pints of beer's worth.

Quote:
Quote:
Quote:
The ground network is a grid of bare wire on the component side of the board. It's a one square per IC resolution.

Oh wow, that's very thorough. My breadboard ground grid is just the regular ground rails plus three or four "vertical" connections between each pair of adjacent rails.
I was inspired by one of Bill Herd's boards: https://hackaday.com/wp-content/uploads ... header.png And also by Jeff's inspirational lecture which proved to be the difference between working and not working for one of my earlier breadboard projects! :)

It seems similar in effect to the grounding Garth recommends for wire wrap, in his primer.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 08, 2023 2:37 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
gfoot wrote:
'd recheck the voltages in case there's some excessive load or a short somewhere, and get hold of a logic analyser to use with the decoder, I think it will give an insight into whether the cpu is executing the wrong instructions or the VIA is responding incorrectly.

It is not very hard to set up and the logic analyser is cheap, just a few pints of beer's worth.
OK, I want to unpack this. When you say logic analyser, I'm imagining something like: https://www.ebay.com/p/1606231146?iid=325735628351, which costs roughly 10x what I paid for my scope even for a used one! Unless something wild is going on with beer across the pond you must mean something else! :P

gfoot wrote:
If you can supply it with 3.3V then it should at least be able to drive TTL level ICs like HCT, ACT, etc, so may still be of use to you.
Honestly, it seems to work fine at 5V; I will probably try to avoid overdriving it all the same, but for now, it's the only one I've got, since yesterday I plugged in the 25.175 MHz one backwards and toasted it. :x :evil:

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 08, 2023 6:32 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Paganini wrote:
OK, I want to unpack this. When you say logic analyser, I'm imagining something like: https://www.ebay.com/p/1606231146?iid=325735628351, which costs roughly 10x what I paid for my scope even for a used one! Unless something wild is going on with beer across the pond you must mean something else! :P

That one has a lot of channels. The one I use, that hoglet recommended, is I believe Cypress FX2LP. eBay looks to have loads of them, or aliexpress. See hoglet's docs here: https://github.com/hoglet67/6502Decoder/wiki and especially his part 5 post: https://stardot.org.uk/forums/viewtopic ... 48#p182748 as well as part 6 and maybe part 7, a few posts later in that thread.

Quote:
Honestly, it seems to work fine at 5V; I will probably try to avoid overdriving it all the same, but for now, it's the only one I've got, since yesterday I plugged in the 25.175 MHz one backwards and toasted it. :x :evil:

Oops! I made a current-limited power supply a while back to protect against this sort of thing, it cuts the power if more than a configurable amount of current is drawn, and for small 6502 projects that can be just 100-200mA. I don't actually use it any more, but not for any good reason, I just lost it when I moved house and packed all my old projects away!

I also fried an ATF16V8 the other day by having another part of the circuit without VCC connected, it was not happy about that. It must have been sourcing all the power for the other components through its outputs.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 08, 2023 8:27 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
gfoot wrote:
I made a current-limited power supply a while back to protect against this sort of thing, it cuts the power if more than a configurable amount of current is drawn, and for small 6502 projects that can be just 100-200mA. I don't actually use it any more, but not for any good reason, I just lost it when I moved house and packed all my old projects away!
I should do that. I'm really behind on power supplies; I'm still using a 5V wall wart for cell phones etc. I have some old ATX PSUs that could easily be converted into a bench power supply, I just keep doing other things that seem more interesting. :)

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 08, 2023 8:36 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
Sooooo. Here's "Blue" August on breadboards. (There's a blue LED, it counts, right? Anyway, it's the same design.)
Attachment:
20230808_162250.jpg
20230808_162250.jpg [ 4.19 MiB | Viewed 6212 times ]
This gave me much more the results I expected. It immediately worked the first time I plugged it in. I only have a 8MHz oscillator for testing, which divides down to 4MHz and 1MHz respectively for the fast/slow clocks. However, I do have a 32MHz oscillator that is too fast (my decode logic is too slow for 16MHz) and a spare flip-flop. So if you look over there by the ROM you can see the 32MHz oscillator tucked in there, running the system at 16MHz divided down to 8MHz and 2 MHz for the fast / slow clocks. I think it can go faster, but I don't have any other oscillators! I need to build one of Garth's variable oscillators.

It seems perfectly stable; I have it spamming "OK"s to the LCD as fast as it can. If it crashes I will see the cursor blinking on the LCD in the spot that it was whenever the system crashed. So far no crash!
Attachment:
20230808_162314.jpg
20230808_162314.jpg [ 4.16 MiB | Viewed 6212 times ]

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 08, 2023 8:45 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
Paganini wrote:
Sooooo. Here's "Blue" August on breadboards. (There's a blue LED, it counts, right? Anyway, it's the same design.)

Big mess ’o wires!  I’ll have to take your word for it that LED is blue.  :D

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 08, 2023 9:53 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Well it's good that the design works. I wonder whether it's worth going over the board and reflowing all the solder joints, just add a bit of flux or fresh solder to each?

My "power supply" doesn't do any voltage regulation, it just controls the existing 5V coming from a "wall wart" as I think they're called. It has soft power buttons and a potentiometer to define the current limit, and specifically turns itself off when the limit is reached rather than browning out the voltage like most power supplies do.

Thinking about it it would be better to supply a bit more and use a regulator, as there was a bit of voltage drop across it for large loads, but most of the stuff I do is such low current it doesn't matter.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 08, 2023 10:48 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
Paganini wrote:
It seems perfectly stable; I have it spamming "OK"s to the LCD as fast as it can. If it crashes I will see the cursor blinking on the LCD in the spot that it was whenever the system crashed. So far no crash!
Attachment:
20230808_162314.jpg


Glad to see it works in breadboard form too!

I would recommend more than just "OK", something like an incrementing binary number or word with say 7 letters in it. Does that LCD display all of it's video memory at once? I know the 16x2's have a ton of invisible characters. If your computer stopped somewhere there you wouldn't be able to tell.

This was definitely not the turn I expected, but I'm glad it still works even here. Remember that your previous board does work (right?) but just only as slower speeds. This new design would or is proving that it was a physical problem with the previous board, not a logic issue.

Oh, and I only use USB wall-warts for my 5V power supply, but I recently got a big variable power supply thingy from the college (for free!). I have yet to actually use it though.

Thanks for the pictures!

Chad


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 09, 2023 12:45 am 
Offline
User avatar

Joined: Mon Mar 06, 2023 9:26 am
Posts: 88
Location: UK
Quote:
I know the 16x2's have a ton of invisible characters.


Even the 40x2s have a few invisible characters at the end of the first row. Plus the one I had had yen in place of backslash, so I had to mess around in CGRAM. But that's a story for another time.

_________________
probably the youngest person on this forum


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 09, 2023 1:41 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
sburrow wrote:
This new design would or is proving that it was a physical problem with the previous board, not a logic issue.
Yep! That's mostly why I made it. It only took a few hours. I figured if I really had made a logical error someplace having it on a breadboard would give me a chance to figure it out and correct it.

Quote:
I would recommend more than just "OK", something like an incrementing binary number or word with say 7 letters in it. Does that LCD display all of it's video memory at once? I know the 16x2's have a ton of invisible characters. If your computer stopped somewhere there you wouldn't be able to tell.
It does, actually. But I think that more broadly you might be suggesting that repeating 4 lines of code and a few subroutine calls is an insufficiently taxing / revealing test, and you are right. :)

I will have to have a good hard think about whether to do as George suggests and try to fix the existing board, make a few adjustments and build a new one, or accept a bit of delay and make a PCB version. I guess those 3 things are not mutually exclusive, but I am leaning towards options 2 and 3. Looking at the (let's call it) prototype board is making me kind of grumpy.

_________________
"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  [ 178 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 12  Next

All times are UTC


Who is online

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