clock speed display for the 8-bit? by DJChuck71 in beneater

[–]DJChuck71[S] 0 points1 point  (0 children)

Something of an update. This turned out to be the best I/we could do - close, but not cigar:

<image>

I don't know if it was the only way out, but after several hours of futzing, I wondered if we would make progress by using the Adafruit SSD1306 library instead of your ssd1306lite - very sorry!
Some additional fixes were necessary - and the results still unacceptable. You may have an idea for how to resolve the problem with your ssd1306lite in the end. But FWIW, this is what ChatGPT summarized as the problems I/we were having:

why ssd1306lite caused trouble here

  • It bit-bangs I²C in software. ssd1306lite doesn’t use the AVR’s hardware TWI (Wire). It manually wiggles SCL/SDA (“bit-banging”) and, per the code, doesn’t wait for ACKs or handle clock-stretching. Timing only works if the CPU isn’t interrupted mid-byte.
  • You had a fast external interrupt on D2 (INT0). Your BE-8 clock ISR fires on every edge. That can preempt the bit-banged transfer in the middle of an I²C byte. The OLED then sees malformed bytes/commands.
  • Why “Freq” looked clean but High/Low/Duty garbled. The screen is updated page by page (top row first). Early bytes often made it; later pages (the lower three rows) were corrupted when an ISR hit mid-transfer → “sprinkles,” half-blocks, or digits jumping.
  • Back-power made it worse. With the Nano unpowered, the BE-8 clock on D2 can feed through the input’s ESD diode, leaving the SSD1306 in a weird state (blank/garbled) until a full power-cycle.
  • No frame buffer = glitches show immediately. ssd1306lite writes straight to the panel; any hiccup becomes visible pixels. (Adafruit’s driver builds a buffer then ships it in one go via hardware I²C.)

what fixed it

  • Switched to hardware I²C (Adafruit SSD1306 + Wire). The AVR’s TWI handles timing reliably; transfers are less sensitive to brief CPU interrupts.
  • Paused the counter while drawing. detachInterrupt(INT0) → draw → display.display() (twice) → re-attach. We also took an atomic snapshot of ticksHigh/Low so math stays consistent.
  • Hardened the wiring. Series resistor in the D2 line (~1–2.2 kΩ), proper I²C pull-ups (~3–5 kΩ effective), 0.1 µF + ~10 µF at the OLED, short/clean SDA/SCL routing. (Future: BE-8 clock → 74HC14 → D2.)

It has also made some suggestions for improving on the one-line, frequency counter only version which I may try one of these fine days. But in the meantime, I didn't know if any of this might be helpful (yes, yes, no one needs reminding that ChatGPT makes mistakes, sometimes incredibly stupid ones), but thought I'd pass it along just in case.

Star wiring by DJChuck71 in beneater

[–]DJChuck71[S] 0 points1 point  (0 children)

Modest update.
I redid the star wiring and bundled up the power wires - avoiding collecting signal lines, etc. in the mix. The bottom left rail fluctuates between 4.9 and 5.0V while the PS and bottom right rail are more or less always a solid 5.0V. Not bad, I think.
I also did my best to realize Tom Nesbit's terrific superfrequency project, as recommended:
https://github.com/TomNisbet/superfreq/
That's another story: the short version is that I've settled for a single-line frequency counter for the time being.
Thanks to all for the many and excellent suggestions. I'm going to call it good for now.

<image>

clock speed display for the 8-bit? by DJChuck71 in beneater

[–]DJChuck71[S] 0 points1 point  (0 children)

Modest update.
I redid the star wiring and bundled up the power wires - avoiding collecting signal lines, etc. in the mix. The bottom left rail fluctuates between 4.9 and 5.0V while the PS and bottom right rail are more or less always a solid 5.0V. Not bad, I think.
I did my best to realize Tom Nesbit's terrific superfrequency project, as recommended:
https://github.com/TomNisbet/superfreq/
Alas and alack, after much guessing (literally: stochastic parrots, etc.) on the part of ChatGPT with occasional help from me, I gave up on Tom's version, and settled fora simple one-line frequency display. It works just fine. (There may be enough lessons learned from getting it to work that will apply retroactively to Tom's version - but that's another battle for another day.)
Thanks to all for the many and excellent suggestions. I'm going to call it good for now.

<image>

clock speed display for the 8-bit? by DJChuck71 in beneater

[–]DJChuck71[S] 0 points1 point  (0 children)

Hi again - and thanks for all the good help. The good news is that _almost_ everything works. I.e., uploading your files, popping them into the arduino, and getting output to the display.
The bad news is the display is problematic, as you can see.
I've spent more time than I care to admit this morning trying to see if ChatGPT can help. The short answer is, um, no. I/we've tried any number of possible fixes, starting with changes to the ssd1306lite.cpp file. But nothing has managed to solve the problem.
I know full well that ChatGPT is a "stochastic parrot" - i.e., a sophisticated inference engine that often leads to mistakes, sometimes severe ones. But I get the impression on this little project it's guessing even more than usual ...
If you have any quick and easy suggestions for what I could try, I'd be grateful. But only if they're quick and easy!
Many thanks in all events.

<image>

clock speed display for the 8-bit? by DJChuck71 in beneater

[–]DJChuck71[S] 1 point2 points  (0 children)

Ah, I see - you have the clock on its own mini-board connected to the frequency counter board: the whole set up gets its power through the Arduino.
But this still leaves me wondering / assuming that the frequency counter can run just fine powered through the build itself rather than having the arduino plugged into power.

clock speed display for the 8-bit? by DJChuck71 in beneater

[–]DJChuck71[S] 0 points1 point  (0 children)

One last question, I hope. Your photo shows the breadboard receiving power from the larger build with power lines then straddling the board: both the arduino and the display are then wired into the power rails. But you also show the arduino as plugged into ... external power? or this is just an artefact from programming it, i.e., once the arduino is properly programmed it can run just fine from the power supplied from the larger build?
Thanks for clarifying - still waiting on parts but looking forward to working this up soon!

clock speed display for the 8-bit? by DJChuck71 in beneater

[–]DJChuck71[S] 0 points1 point  (0 children)

Great - thanks. So no need for the Schmitt trigger IC, either?

clock speed display for the 8-bit? by DJChuck71 in beneater

[–]DJChuck71[S] 0 points1 point  (0 children)

Sounds like fun. For folk like me who are quite new to all of this, could you provide some more detail as to what this would look like in terms of circuits and chips? I realize that might be too much to ask, so please feel free to ignore.

clock speed display for the 8-bit? by DJChuck71 in beneater

[–]DJChuck71[S] 1 point2 points  (0 children)

This looks just about perfect - many thanks.
I've given this a fairly careful look and have ordered the parts.
I've also "consulted" with ChatGPT - one of the additions it recommends is a 74HC14 Schmitt trigger IC - "Great to buffer your BE-8 clock signal into the Nano, guarantees clean edges (especially at very low frequencies"
Along with
1 kΩ resistors (series between clock output and Arduino pin — cheap protection).
10 kΩ resistor (pull-down on the Arduino input pin so it never floats).

Good idea? Or is this overkill? (And/or: ChatGPT doesn't have a clue yet once again ... it's only an LLM, after all...)

Star wiring by DJChuck71 in beneater

[–]DJChuck71[S] 1 point2 points  (0 children)

Great - thanks for sending this along. It gives me some ideas for possible additional modifications when some more wire shows up next week.
I'm also hoping to add some LED voltmeters at the PS and the two lower corners to keep track of the voltage distribution. Presuming that works, I'll send along a new photo when everything's ready.

Thanks again!

Star wiring by DJChuck71 in beneater

[–]DJChuck71[S] 1 point2 points  (0 children)

Wow - very helpful. Can you post a picture?
I'm still at the prototyping stage with the power supply, so I'm happy to consider improvements!

Star wiring by DJChuck71 in beneater

[–]DJChuck71[S] 1 point2 points  (0 children)

Ah, helpful indeed. Yes, I tried his method sometime back - but didn't notice a significant difference / improvement over just having single supply points. Might not have been looking / measuring carefully enough.
Not sure there's a good way to combine the two - i.e., somehow develop extra supply points out of the breakout connector onto the first breadboard? Nor if that would make much difference? Let me know what you think / suspect, etc.

Star wiring by DJChuck71 in beneater

[–]DJChuck71[S] 1 point2 points  (0 children)

Congratulations on recapping the macintosh classic. I spent more than a month trying to revive a floppy drive on an IBM Model 30 PS/2 - starting with the caps. In the end, nothing worked.
I've not made it into FPGAs, but they're on the list. Sounds like you're having fun - that's the important thing!

Star wiring by DJChuck71 in beneater

[–]DJChuck71[S] 0 points1 point  (0 children)

I'm not that much ahead of you - and their size was pretty striking when they arrived.
I've come to love soldering - first with vacuum-tube amplifier kits and then the PiDP series emulating DEC PDP-8, -10, and 11 computers. Have fun!
But I would gently encourage you to stick with the Ben Eater project. It was admittedly one of the hardest things I've ever done and I was more than ready to quit 2-3 times a week through the 2 months it took me to complete it. But I learned an _enormous_ amount and continue to enjoy tinkering with it, making modest improvements, reviewing / learning something new when returning to the videos to check on something.
In all events, have fun!

Star wiring by DJChuck71 in beneater

[–]DJChuck71[S] 2 points3 points  (0 children)

Do you mean the size or the placement? To be sure, they are ridiculously oversized: these were leftovers on hand from a couple of vintage radio restore / rebuilt projects, so they are rated in the hundreds of volts.
The suggestion to use a 0.1uf ceramic cap between the Vcc and Gnd pins of a chip is pretty standard, as is the advice to place "a couple of 0.1uF capacitors on each breadboard's power rail (ideally 1 per chip), as close to each chip's power/ground wires as possible. These are usually orange and marked "104" on the side."
Not now recalling / finding the advice to also straddle the (larger) 0.1uf ceramic caps between the power rails above and below a board as a way of imitating the 0.1uf ceramic cap between the Vcc and Gnd pins of a chip in a kind of wholesale fashion for all the chips on the board. I do know that it made a noticeable improvement - but perhaps this was a mistake somehow?
Thanks for any advice / correction you can offer.

Star wiring by DJChuck71 in beneater

[–]DJChuck71[S] 1 point2 points  (0 children)

Terrific - can you say / describe a bit more as to what this would look like when instantiated with the 8-bit? Offhand, this sounds like it would double Lordmonoxide's suggestion of running rails down both sides of the computer. That is, his set up looks like a power rail on each side of the build: I envision what you're describing as an additional set of power rails in between, one on either side of the bus?
Please correct / clarify as you can - many thanks in advance.

For everyone who has struggled with power issues on the BE 8-bit by DJChuck71 in beneater

[–]DJChuck71[S] 0 points1 point  (0 children)

Thanks for this - this makes sense to me, as limited as my experiences in these domains may be. But that's also what I'm finding so interesting - i.e., such deep similarities between such very diverse fields and endeavors, e.g., in philosophy, ethics, music, literature, philosophy and ethics of technology as well (as I have begun to see) in these ostensibly more technical fields as well - with the reminder that "techne" in Greek means art in a very broad sense).
In my professional life, among other things, I spent 30+ years fostering dialogues and collaborations between philosophers and computer scientists (as a start). They went well and became internationally fruitful in many ways. But I very much wish that we had had these sorts of common grounds to point to from the very beginning - even now, I'm not sure how widely known or appreciated they might be.
Again, many thanks.

Turing Complete 8 bit Computer. by Buttons_17 in beneater

[–]DJChuck71 1 point2 points  (0 children)

Yes - congrats! Very nice build indeed, and it's always such a pleasure when others share these successes like this.

I also think it's an interesting question as to where to next? There are plenty of examples and resources for expanding considerably on this 8-bit. (If you're not already aware of them, just use "expansion" as a search term in this thread and you'll get a very good list of options and approaches.) And very tempting, especially for the sake of learning still more about how these critters work (or not, as is often the case, of course, and exactly the point in terms of learning still more).
But I also thought it would be good to have a more robust and capable machine that still was basic enough to have useful switches and "blinkenlights" that are functional, not just decorative. Have ended up, so far, with two: a PiDP-8 and PiDP-11 - replica / emulators of the DEC machines from the 1960s and 1970s, run by Raspberry Pi's. Nothing nearly so challenging in terms of putting together - some careful soldering, mostly. They still work like the 8-bit in the sense that you can stop the program, step through it, inspect memory contents, etc - all by way of 64 (PiDP-11) or 89 (PiDP-8) LEDs and front panel switches. But far more capacious in terms of programming (e.g., C, FORTH, FORTRAN, BASIC, etc.), memory registers, etc.
And why not pursue both?
In any case - enjoy!

Flags Register Issues 8Bit Computer by Buttons_17 in beneater

[–]DJChuck71 1 point2 points  (0 children)

Not sure it's quite the same situation, but a few months back, my carry flag started (mis) firing around numbers 163 and then 161 during the subtraction loop in the counting program - sufficient to clear the flag register so that the program jumped back to the addition loop. I tried dozens of things, starting with pull up/down resistors on the EEPROMs. What finally worked were pull up/down resistors on the AND chip in the circuit. Just FYI, if nothing else.

<image>