-
I test my MCUs and melt one chip
10/18/2018 at 03:50 • 0 commentsI don't have any 6 or 12 MHz crystals but I have active crystal packages (containing the active components to oscillate when power is applied). I also don't have the 22 pF capacitors to go on both sides of the crystal. So I will have to order crystals and capacitors for production, they are cheap enough.
In the event, it was good that I used an active oscillator, because I added a binary divider IC (74LS74) so that I could use 6 and 3 MHz clocks to check my MCUs.
All of my MCUs work at 6 MHz. Some can be clocked to 12 MHz.
There was one that didn't blink the LED when powered up. Then I noticed the power supply voltage was drooping. I touched the chip. Ouch! It must have been molten silicon inside and soon the smoke inside would have escaped. The chip was not labelled 8042 or any of the other numbers, just read Fastest BIOS chip. So it could have been another chip, maybe an 8051, or even a bespoke chip just for that motherboard. After all the interface to the x86 CPU has only to be at the register level, and the interface to the keyboard at the serial line level. I probably killed this chip, but never mind, I don't know what it might be and will never know. Anyway heads up, check that your chip is from the 8042 family if you don't want to let the smoke out of the chip.
-
I dust off my breadboard
10/18/2018 at 03:39 • 0 commentsSo I brought my breadboard out of storage and prepared a whole bunch of jumpers from telephone wire in my junk box. I have 4 cm and 6 cm length of various colours. I repurposed a PC power supply as the 5 V supply.
Arrgh, I need longer lengths of jumper wire. Although I can make the 6 cm wires reach if I "fly" over the IC, I should really route them on the side so that I can easily plug and unplug ICs so that i can test all the MCUs I have. So I made some 8 cm and 10 cm lengths too.
The breadboard space gets used up quickly, so I've also ordered a larger one for future projects.
-
I need new LEDs too
10/18/2018 at 03:32 • 0 commentsWell I've tested the seven-segment LEDs I had in the junk box and they were pathetically dim. That's not surprising, LED efficiency has been going up all the time and they now compete with CFLs for lighting.
So I threw my old displays out and will buy some new ones from eBay.
Hmm, browsing eBay for displays shows some 4 digit modules but only 4 connections, 2 for power and 2 for clock and data. What's with that? More research shows that they contain the TM1637 chip and can be driven with a serial protocol. Here's how to do it from Arduino.
If I use these displays which are cheap enough, I can dispense with the latch, buffer, anode transistors, current limiting resistors, and a whole lot of pain wiring it up.
Ok done. I have writen the bit banging code to drive these serial interface displays. Some back of the envelope calculations show that updating the display will take about 250 μs. The display only needs to be updated once every half-second, to blink the colon, and the tick interval is 4 ms, so there is enough margin. Actually since the display does its own refresh, I can even increase the tick period, but I'll do this only if testing shows that it's inadequate.
I also changed the font table because the mapping of bits to segments is different in this display.
-
8042 architecture
10/18/2018 at 03:22 • 0 commentsWell I think I have read the 8042 datasheet enough times and browsed enough webpages to understand that it's quite similar to the 8048, a major difference being that the low byte of the address goes out on port 1 instead of being multiplexed on the data bus. This means to use port 1 I have to demux that, with a different latch because of the timing waveforms.
Another difference is the lack of an I pin. But I won't be using mains frequency as the clock reference anyway so it doesn't matter. I investigated the frequency divisor arithmetic and understood that I would have to use a crystal frequency that is a multiple of 3 so that there are an integral number of clock cycles in a second. Fortunately crystals are not expensive these days. I looked at ceramic resonators, but those are not accurate enough. Can I drive them at 12 MHz or will I have to settle for 6 MHz? It will depend on what the MCUs I have can do.
I can reuse the circuit design and code from my plasma clock project but I will have to design the cathode and anode drives. For the anode a PNP transistor driven off 4 port 2 pins should work. The pin will be pulled low to turn on the anode, just like the plasma clock. For the cathodes, I don't want to use discrete transistors. I could use a couple of 7406 hex open collector inveter ICs, these can sink 20 mA, which might be enough for 4 multiplexed digits as that's roughly equivalent to 5 mA constant current. Hmm, I don't have enough 7406 ICs in my junk box. Following a tip in a forum I'll use a 74LS244 8-bit line driver IC instead; I have a lot of these. This is non-inverting so means the line has to be pulled low to turn on. So I have to invert the font bits in the firmware.