Archive for March, 2022

Lego train v2

March 17, 2022

I already have an update. That l298 motor controller was way overkill for this and did not really fit where I wanted it to go anyway. I decided that if I’m going to be standardizing on stuff for this project it has to be small, cheap, and plentiful. I really like the d1mini because it’s about as small as I can make a board that’s easily reprogrammable, but also that there are some shields for it. In this case a motor shield. It uses an stm32 and takes commands over i2c.

The strangeness starts here though, because when looking for libraries to talk to it I found that most people upgrade the firmware on them. Well, on the one I got at least. Because it’s cheap. And the old design. So I upgraded the firmware, no big deal. Then the software didn’t want to talk to it.

helpful FTDI header for upgrading firmware

After throwing debug statements into the software, I eventually dug into the source for the new firmware I flashed. What do you know, it doesn’t support stuff that library was trying to access. I briefly debated adding stuff to this open source firmware, but I found the older library that was meant to talk to the older version of this board and it all worked. Here’s how it goes:

  • The WEMOS version of this board is v1
  • that board had a bug in the firmware
  • the open source firmware replacement replicated the functionality of this firmware without the bug
  • this board has a library to talk to it
  • the LOLIN version is called v2
  • this board does not ship with a buggy firmware
  • it DOES however have additional features not supported by the old firmware
  • this board has a DIFFERENT library to talk to it

So, using the wemos board (clone, I’m sure), the open source firmware replacement, and the wemos library I was able to make this whole setup move. And some people, for some reason, expect things to ‘just work’. In my experience, that is a myth.

This setup is much more compact, but I did have to add the voltage regulator down to 5v external of the board, so this is really 3 modules.

LED matrix sign

March 15, 2022

I feel like I’ve done this before. It really seems like I’ve made a post about this before. At least the code for the arduino that proves these sign segments out. Well, now I have a full sign driven by a raspberry pi.

Original sign with reverse engineered code.

I got these sign segments from a friend who got them at a scrap yard. They weren’t all perfect, but they were pretty darn good. I reverse engineered the whole drive circuit for one of the boards and generated code to drive them from an arduino. I originally bit banged the whole thing, but then I moved to hardware SPI because that’s really what these signs talk. They use tb62726afg constant current LED drivers as well as some addressing to pick which line you are streaming data into. These are red/green only, but other than that they are reeeeeeeally close to the RGB ones adafruit sells. They are compatible with “HUB75” panels, electrically. That means that all the adafruit code and documentation will work, with some slight wiring modifications.

The adafruit bonnet was out of stock when I did this, so I cloned the hardware, kinda, I stole the pinout and used some buffers I had and adapted the wiring to my displays. These days I’d lay out a board, but at the time this was faster and easier.

These boards have soldered on mounting posts, and not all of them are present anymore. There are enough, however, to make the whole thing go together on a big lasered backer board.

There were some ghosting problems, but Frank helped me sort them out.

Brandon helped me laser the mounts and Frank supplied the 40A 5v power supply.

It all tucks away very nicely. Now there needs to be some sort of script on boot that pulls from a rotating set of ‘slides’ that can display images, text, moving images, or moving text. I’m thinking a python script that iterates over a folder full of text files.

photos of the thing are here

carry-1 covox sound card / cast epoxy key

March 15, 2022

Frank and I picked up a nice PC compatible computer at an estate sale, the Carry-1. It’s (at the time at least) the world’s smallest PC compatible computer. It takes an XT protocol keyboard, has the whole chipset boiled down into one chip, has ram upgradeable to 640k, up to 2 floppy drives, and the chipset also has a CGA compatible output (but it doesn’t run the 8088mph demo) with composite and a parallel port. It runs a NEC V20 processor with firmware that can clock it up to 10Mhz. So now my problem is getting an XT compatible keyboard. Luckily at VCFmw there was one for sale for only a couple bucks. It was missing one key however. That was a problem because the spring that sat between the keyswitch and the key held up the foam and foil keyswitches, so without the spring it had a stuck escape key. I swear I almost cried when I saw those foam pads again, but miraculously these had not perished, not one.

Here you can see my setup, a vacuum pump, vacuum chamber, mold release spray, 2 part silicone for making molds, and foam core board and a hot glue gun for making the mold. I decided to vacuum degas the silicone before pouring into the mold (the other half of the first mold was filled with that crayola brand modeling clay stuff). You can tell I watched Adam Savage’s video on this. Some tips:

  • take some care in making a foam core mold base, it doesn’t seem like it being rectangular matters, but it helps to make the second half of the mold.
  • spray vegetable oil as mold release works well, but flashes off under vacuum, you should really degas your resin or silicone, but pressure cast your items once you pour into the mold.
  • resins take a lot longer to cure than the manufacturer says, especially when it’s amazon cheapie-special
  • silicone mats are great for peeling epoxy messes off of
  • clean up your parts when they’re slightly gummy, they are easier to work
first key, with void, second time the mold didn’t seal perfectly

It works though!

So, now, what do we do with the carry-1? Well, it’s going to be a testbed platform for developing a usb-to-xt keyboard converter. It also needs sound, clearly…

8048 programmer, 2708 programmer, and 1702 programmer

March 15, 2022

This isn’t something I designed, but I really like building capability in my lab so I got these to help dump microcontrollers and eproms. I’ve used the mcs-48 programmer already to dump code from microcontrollers and the 2708 programmer helps not need a bunch of power supplies to read 2708s as 2716s in a conventional eprom reader. The 1702 programmer was the most difficult and the most un-needed (by me) but you never know when parts are going to go end of life and I’d have to redesign this thing and there’s no way I want to do that. I only had one issue on the whole set and that was a dual transistor I toasted on the 1702 programmer, but I always buy spares. If you want boards or spare parts let me know, hand soldering all of these once was enough for me…

flux not yet cleaned off from the repair I had to do

LED direction board

March 15, 2022

for many years I wanted to do this project, it’s so simple and I already bought the parts for it. All it does is detect the state of an IO pin on a microcontroller. The special thing is it detects high, low, or high-z. It’s green/red so it’s especially not useful to Frank, but I like it a lot. You can use it on logic that goes down to *just over* 3.3v because of the way I designed it.

The special thing I did is use LEDs that are wired against each other, if the voltage flows one way one LED lights up, if it flows the other way, the other one lights up. If the pin is high-z, then no current flows and nothing lights up. This is accomplished by one leg of the LED being tied (through a resistor) to the microcontroller pin and the other leg being tied to a voltage regulator set for exactly half of Vcc. I say ‘exactly’ but if your LEDs have different voltage drops and you want the same current through both of them with one resistor you may have to tweak the voltage off of center to accomplish that. I installed a spot for fixed or variable voltage regulators based on the 1117 style (pretty much the successor to the 78xx/317/337 stuff).

teeny, but I could cram those resistors closer, or use a resistor network, and make the regulator able to be snapped off so multiple boards can use one regulator

The problem with this design is that you need LEDs that are a bit below half the voltage drop so there’s room to regulate that current with a resistor. You can’t find much below 1.65v LEDs, not in this package. I have thought about how else to do this. I can just have one LED pulled high and one LED pulled low from an IO pin, but the problem there is will I get both LEDs to light for a high-z signal? I think that would happen for logic levels over 3.3v, but for levels between 3.3v and 1.7v only one will light because of the forward voltage drop of both LEDs in series being too much for the voltage rails to push through. I could do something like this with comparators, but how do I detect a third state? perhaps 2 resistors and some transimpedance amplifiers? Yeah, I’ll bet you never thought you’d actually hear that word outside of college. The problem there is that I need 2 op amps per IO pin, that’s a lot bigger board and I’d rather keep things simple. Anyway, it works, board files here:

GPIB breakout/future fujinet capability

March 15, 2022

I’ve been knocking out circuit board designs at a crazy pace this year. One of the things I wanted to do was help some with the fujinet project to get it on to other platforms. One of those platforms is the commodore PET. To do this I needed a couple boards. Well, I only really needed one, but I wanted to make it general purpose.

This is my GPIB to raspberry pi board. I needed some pinout to go to the esp32, and since that hadn’t been determined at the time I wanted to make this I decided to arbitrarily pick the raspberry pi connector and a pinout compatible with this guy’s code. There’s even a linux kernel driver for use with this configuration, but the one with the line drivers is commented out. You can get the code from here and build it with the omitted control lines back in. I would prefer to have this hardware version supported as another option in the driver, but I haven’t petitioned for that yet. But it does work to retrieve data from an oscilloscope over GPIB

It can also talk to other equipment, but be warned, equipment like the Tek AFG 5105 predate IEEE488.2 and you need to query it with ID?, not IDN?

You may also see a card edge connector there as optional, I added that so this can plug straight into a commodore PET. I checked and double checked the pinout, so it should work, but that has yet to be tested. I also made a breakout board for the esp32 WROVER board that’s breadboard compatible and has headers for the ESP-PROG that can do serial communication and programming in addition to JTAG single step debugging.

I copied sections of the schematic from the wrover kit board seen on this Dave’s Garage video that inspired me to get working on esp32 projects. The esp-prog board isn’t expensive, but also I didn’t want to build those parts onto every board. It’s also quite easy to convert a dead d1 mini with its ch340 and fets to twiddle the control lines and reset line to program over this 2×3 programming header.

Logicode 16550 8 bit ISA serial card upgrade

March 15, 2022

I got an IBM PC with Frank some time ago and have been on the lookout for upgrades for it ever since. It has 8-bit ISA slots so it’s fun to look for stuff that’s compatible with that. I wanted a serial card and I was surprised when I found one, brand new, for $8 US shipped.

And from the listing (still up!) I saw that this was actually the lower spec single serial port version, and that there existed a dual serial port version of this card. So, as I learned from The Splendid Table a long time ago: If you’re going to buy one, buy two.

These cards are SO SIMPLE. And the missing parts are just obvious, another 16550, a 1488, and a 1489. So why wait, it’s actually cheaper to buy these cards and scrap them than to buy the components themselves.

This worked great. The silkscreen showed how to set the jumpers for both ports and everything worked great. I did buy parts to fix up the other card just because I couldn’t stand to have it be scrap, but it was not the financially sound thing to do.

ESP232 code enhancements/porting

March 15, 2022

I did this a long time ago and am just now bothering to write something up for it. I was not super satisfied with the esp-link telnet adapter software, and I wanted to make some smaller simple boards. Enter the ESP232.

This is a marvelous and tiny board that simply combines a rs232 level shifter with a usb port for power and a regulator to get it down to 3.3v. I ordered enough boards and parts to make 10 of these and every single one worked. One of the things I don’t like about this design is the programming header. I could never get it to work and I just gave up and programmed my boards in a spring pin jig.

After digging into the code I found that it didn’t immediately compile on the esp8266. With some help from Frank we got it working on both the esp232 hardware and my old esp-link modules. After some more digging I found I could tweak some things to make them settable through the captive portal. I also added all baud rates supported in the library and basically all the bells and whistles I could. I’m really happy with where it is and all you need to make use of this is a d1mini. Seriously, you couple this to a ttl level serial port inside some piece of hardware and boom! now you can telnet to it.

Here’s the current revision of my code. I had some of my changes pulled back into the original codebase, but not all of them (not sure I remember why).

Kicad carbon contact script

March 15, 2022

I’ve been making lots of circuit boards lately, and I had the need to lay out pads for carbon contacts (specifically on an atari jaguar controller pcb). I found someone’s script on github that does basically that, but I needed some extra features.

First I needed rectangular contacts, so I added width and height instead of diameter. But that made me think about how the circular pad didn’t use those fields. How hard would it be to make oval contacts?

Hard. Well, too hard for me to do easily. I enlisted Frank’s help and now things work significantly better. There’s still issues at the edges, but it’s probably good enough to make functional designs.

We talked about doing the sides with special purpose arcs instead of segments, and fixing the gap spacing on the left and right between the fingers and the opposite side of the pad. There’s also the bottom corners that don’t meet properly. Lots of stuff to fix, but I didn’t even need oval pads. They just seemed like the logical extension of square, rectangle, circle, … it’s gotta be oval, right? this is like an SAT question.

Here’s my latest code.

AMC Eagle Test Box v1.4

March 15, 2022

Previous entry here, simulator here.

I decided to jump all the way to 1.4, adding all the circuitry I had planned plus some additional stuff. There’s three circuit boards in the box, doing 4 things total. There’s a 4050 board that buffers all the signals for the LEDs, this is probably not needed, but it puts less parasitic drain on the vehicle. I had some issues driving this box with the engine simulator, so that made it a bit more robust. There’s the board I described in the last post that generates richer and leaner signals from the quadrature stepper signals. And there’s this new board that contains a simulated throttle position sensor and indicator of if the engine is at temperature. The engine being at temperature means the stepper motor can take over control of the carb, so that lets you know what mode the engine computer is in. The simulated throttle position sensor uses the vacuum switches and wide open throttle switch to estimate how much throttle you are running at. I added these features so it’s easier to ‘read the tea leaves’ without having to know how everything works.

I terminated all the wiring at screw terminals, and from there wired the box. The screw terminal layout is here, with the templates for the side sticker as well. The logic is all implemented with 4000 series logic because that can operate natively at 12v, no level converters needed.

I changed the code for the test box to simulate the richer/leaner stepper signals, I also have conditions for engine at temp and different throttle positions. Now, who wants this wonderful project car?