Archive for September, 2020

Colorburst oscillator for TIA FPGA project

September 13, 2020

I’m working with Frank on this TIA replacement because it turns out that even though there’s tons of information on the TIA, basically no market full of surplus chips, and even some incompatibilities with later versions of the chip no one has made one yet. I don’t mean to say that no one has emulated the TIA, that’s been done in PC based emulators and MULTIPLE FPGA implementations, but no one has actually produced hardware that could replace a broken TIA chip. For the price of an NTSC TIA on ebay you can buy one or two whole 2600 systems, it’s just not reasonable. The first step we need (want, but the hack done to deal without it is not going into the final design) to get done is an oscillator running at exactly twice the NTSC colorburst frequency.

Those caps should be grounded, pretend I drew a ground symbol there under the crystal

Here I have a fairly general purpose multi-output oscillator. This would really be more useful for a completely gate driven circuit where you want some of these inverse signals to trigger other parts of the circuit but I decided it was a useful way to use parts I already had on-hand.

On the left you see a Pierce oscillator made out of a crystal and some 4049 inverters. This is sometimes done with an RC oscillator but here we have a crystal of the proper frequency. In reality I wanted a 2x colorburst frequency crystal, the only one I could find was a 4x colorburst so I used it and added the divider circuit.

Moving right you can see I exposed the buffered 4x colorburst oscillator and inverted it to make a 180* out of phase signal (that’s a gate delay behind). From there I went into a 4013 d-type flip flop that’s running as a divide by two meaning for every two clocks it gets in there’s one clock out. That also feeds a spare inverter which gives you an inverse signal if you want it. Of note, this circuit produces and really only works with a 50% duty cycle clock signal based on how the gates trigger and therefore divide the signal. Using the last stage of that dual d-type flip flop I can make regular colorburst and it’s inverse signal. I still have one spare gate but this circuit has done all that it needs to. Because the chips are 4000 series logic that means it can run down to 3v which is good for modern FPGAs and because I started with 4x it can even drive the ice40 series which seems to only want to start at 10Mhz (but somehow I think it’ll work lower).

Edit: This loading did not work and ended up with an oscillation of about half colorburst. Once I go get a scope that can measure that I’ll try some different values.

Followup:

I finally figured out what’s wrong. Turns out 40xx series CMOS chips are not particularly fast. They are nice because they go up to 10 or 20 volts, but they are not very high speed. If I actually still needed this circuit I would try the 74HC04 because I trust CMOS technology to be a bit more robust to my fumblings than TTL, but if I really wanted to go fast a 7404 or 74s04 might be even faster in this application.

Seeing this solidified it for me

To get a 14+Mhz oscillator I need rise and fall times under 35ns on average. This trace is showing me about 80ns rise times so there’s no way it could switch fast enough to make my oscillator.

Psone LCD conversion, final revision.

September 13, 2020

I’ve had one of these kicking around and fed it composite video as a test monitor for some time, but it’s always been in a sort of unfinished and dangling state. Today I buttoned it all up so it can just be another piece of test equipment.

To get this screen to do what I want there are a couple things I had to do. First was permanently connecting 5v sense in so that the screen powered up:

5v-sense permanently pulled high

Next I had to deal with the sound. I was not hearing anything. Years ago I had tied the headphone switch wire to ground, that did not work and was not what was recommended by the mod guides anyway. Next I followed the mod guides and tied the headphone and headphone switch wires all together. This did not work either. I resorted to checking the lm4835 datasheet and found that the way to permanently set the headphones to disused was to tie the HP Sense line low. I did that and the speakers jumped to life.

I removed a series resistor and injected my signal to that pin.

The next issue was this LED mod I had done years prior. I must have broken the backlight and done this mod when I had much less soldering skill and equipment at hand. I also followed the advice on where to place things which I don’t think was optimal. The circuit is basically three white LEDs in parallel all connected to a single 10R current limiting resistor and that’s connected to 5v. That’s about 56ma per LED. I don’t really believe that but it’s working so I cleaned up the wore routing and soldering and just put it back. Originally the resistor was hot glued to the strip of black electrical tape under the LCD in the center. The problem is there’s a plastic post there so I relocated it to the side of the LCD in the nice open space (and heatshrunk it for more secure insulation).

All that done the screen still had a strange blown out look and I remembered that there is a ‘brightness mod’ that was mentioned. I had done that and now don’t really like the consequences. Once that jumper was removed it looked a lot better.

You can see the solder joints that I removed a jumper from. That mod looked bad.

The next issue is that the composite and RGB inputs take different audio inputs. Theoretically I could have kept hacking on the amp circuit and injected audio straight into there and ignored the switching circuitry that exists based on which input gets a lock. Instead I just used a double pole double throw switch to use one set of inputs for both modes.

The final issue you can see fixed above. I hate that this takes 7.5v in. It may just feed a couple 7805 regulators but I don’t really want to chance it so I added a regulator so I could comfortably feed it with 12v and not have to worry.

Final (?) iteration of the billy bass project.

September 8, 2020

I’ve been using my time this summer to finish up a lot of long-standing projects. Not that I don’t have a lot of pressing matters to handle right now, but I need a break from them to do some smaller, simple things that I can wrap up easily. I decided that this fish should be one of them.

This has been around for years, and the last time I just repaired the jaw and removed the epoxy blob brain. I had replaced the epoxy blob with an msp430, but this time I ditched that too. Perhaps it would have been simpler to use the existing board to drive the motors, but I found another design that I figured would do most of what I wanted and I could safely copy most of that design. The design I found uses a bluetooth board and audio amp to drive some speakers, then takes that audio signal and reads it with an arduino while moving the fish’s motors with some motor control breakout boards. This works, but I had some issues.

The first issue is a ‘me’ thing, not a ‘fish’ thing. This is the bluetooth chip on the module this kit recommends to buy. I have experience with some CSR breakout boards that use a different chip, and I would have liked to use them here. The benefit to the CSR boards is I know how to reprogram the name of the bluetooth device and they sometimes have power drivers for going straight to speakers which would save some cost and size. The benefit of this board which (for now) outweighed that for me is that there’s an onboard relay that fires when a bluetooth connection is established so it switches from an aux in to the bluetooth automatically. That is a feature I REALLY like and want on something like my car’s radio bluetooth mod. I could probably implement it with a relay and an LED output from the CSR module, but for now the plan is to use a switched headphone jack and do that mechanically. There is someone who’s been playing with these zhuhai jieli chips, but not the one I have (look for AC690X on github).

The next issue was one where I tried to preserve all the functionality of the original device. I wanted to make it battery powered. That would mean fresh batteries would give it 6v, rechargeables (like I would be using) would give it 4.8v or so. That’s not a lot of voltage to start with. The project I linked used a microusb power source, and at least for my older fish that really, really wouldn’t work. I found too much trouble having the unregulated 5v arduino, the bluetooth module, and the audio amp being on the same power rail as the motor controllers. They caused a lot of spikes and frequently led to reboots of the arduino and constantly dropping the bluetooth connection. I eventually had to separate the rails, and that meant using a voltage high enough that I could regulate down to 5v for the logic.

Starting at the top we have the audio amplifier with the green light. That is unchanged from the original design. To the left we have the bluetooth board (the other black board). I elected to use the aux input like it was suggested, now this fish can take any audio device in and speak along with it, it doesn’t have to be bluetooth. That jack is located on the far right side, wired in to the JST pigtail and connectors that came with the bluetooth board. Next to that port is the DC-DC power supply that drives the motor controllers (blue LED). I have this set at around 4.5v, playing with that voltage and the motor speed commands in the code came up with a pretty decent response without browning out a whole bunch of the circuit. Bottom right is the power input jack (now 12v in). To the left of that is the 5v step down regulator (red LED). That powers the whole project minus the motor controllers. On the far left is an old diavolino board from Evil Mad Scientist Labs. That was my favorite board for a long time because it was cheap and minimal, it has since been replaced by the pro mini for the same reason. To the right of that board you can see a trimpot glued down, that is for the audio from the bluetooth board to go to an analog pin of the arduino. I made a nice hole in the battery compartment so it could be adjusted, turns out it really doesn’t help much. Above that is the motor controllers (red boards under the fabric). They’re cheap, and this guy wrote a library to use them so I just used them.

I could cherry pick a clip of audio where the speech seems to sync permanently, but this is most representative of how well it works. I think it’s pretty good. Here’s some things I should change in the code and some final thoughts. I added the button and the light sensor in, the button just flaps the tail and the light sensor isn’t implemented yet. I had to add a bit of code to drive the mouth shut because the spring just doesn’t do it fast and it doesn’t close all the way. That code should check if the mouth is closed and not try to do it again because since I did that the mouth is perpetually driven closed during silence. Speaking of the mouth, it broke again. I got fed up with plastic and bent a wireframe out of 12AWG solid core copper and soldered it on to the metal shaft. I really wish I had a picture, but I’m not taking that fish apart again if I don’t have to.

EDIT: I just couldn’t leave it alone. I wish I had put a hole in the back for a programmer so I didn’t have to open it up to reprogram it but I made a change to only close the mouth once unless it’s been opened again. The code is on github and really rather simple. Now I can leave the fish powered on at all times (and let’s hope I remember to disconnect or it’ll be flapping its lips as a recruiter tries to get me to talk back into a non-existent microphone.