The Atmel’s Universal Serial Interface (USI) sucks for I2C

Quick Intro to I2C

Along with USART and SPI, I2C is definitely the most common interface used by a microcontroller to communicate with peripherals. In order to implement an I2C bus all you need is two open-collector collector pins, one for the SCL (clock) line and one for the SDA (data) line.  It has to be open-collector because there are times during the protocol when two devices drive the clock line at the same time which can lead to a short circuit if one device drives it high and one drives it low. This way, the bus lines are high by default due to the pull up resistors –  if a device wants a line to go low, it just shorts it to ground via an internal transistor. There is no path from VCC to GND that does not contain a high-valued resistor.

Continue reading “The Atmel’s Universal Serial Interface (USI) sucks for I2C”

Project: Nixie Clock (upgrade) – SPI Bus Chip Select/GPIO Contention

As discussed in the previous article, the display is controlled by a number of shift registers. Shift registers can be controlled directly by a SPI bus, which is useful as most microcontrollers (including our ATtiny87) have a built in SPI bus peripheral. This means that writing a byte to the shift register is almost as easy as just writing a byte to a register.

Continue reading “Project: Nixie Clock (upgrade) – SPI Bus Chip Select/GPIO Contention”

Project: Nixie Clock (upgrade) – Final Schematic and PCB

One big change since I did the first version of the clock is my access to professionally made PCBs. At the time, I was only able to produce PCBs via hand etching or using my home-made PCB mill. A board like this requires at least a double sided design which is not easy using the above methods and so I used veroboard. This is painfully slow and messy.


For the new version I will use a professionally made two layer PCB.

Continue reading “Project: Nixie Clock (upgrade) – Final Schematic and PCB”

Project: CRT Oscilloscope LCD Mod – Choosing the replacement LCD

I’m replacing the screen on the logic analyser for a few reasons:  The CRT is heavy and bulky – replacing it would make the whole thing lighter, an LCD could be brighter and I can add colour to the monochrome display, and on top of this it’s just an interesting project. The most important thing is that the replacement screen is not worse than the old one!

Continue reading “Project: CRT Oscilloscope LCD Mod – Choosing the replacement LCD”

Project: CRT Oscilloscope LCD Mod – Simulating signals

After putting this project on the back burner, I am focusing on it once again. Brian HG on the EEVblog forums suggested that a simple line doubler would make the signal compatible with most modern VGA displays. What that means is that each line in the frame needs to be repeated twice, at double the speed.

Currently we get a new line every 40 microseconds, but this is too slow for most displays to be happy about. Therefore, if we record each line and output it twice at 20 microseconds each most VGA displays will be ok with it.

Continue reading “Project: CRT Oscilloscope LCD Mod – Simulating signals”

Project: Spectrum – PCB V1, a bit of a disaster

With all of the sub-systems developed on a breadboard I moved to the next step of designing and ordering the circuit board that I would use for the final product. For now, I will skip over the design choices and jump straight to what happened when I received the board and what the mistakes were and how I have changed my design.

Continue reading “Project: Spectrum – PCB V1, a bit of a disaster”

Project: Spectrum – Filter Design

Frequency Response

As I said in the previous post, I want my filters to perform in the same way as the MSGEQ7. The frequency response of this chip is given in it’s datasheet.


The 7 frequency band responses of the MSGEQ7

From the datasheet I can see that, to replicate this response, I will need 7 bandpass filters at 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz and 16kHz. Each filter will need a quality factor of 6 (this basically sets the bandwidth of the filter).

Continue reading “Project: Spectrum – Filter Design”

Project: Spectrum – Beginning

It’s getting harder and harder to find spare time to work on projects. Firstly, the holidays at MIT are tiny compared to the holidays I get at Cambridge, and now that it’s finally Summer I am doing an internship which keeps me pretty busy 5 days a week, and I still want time to explore California and surrounding areas.

Anyway, I want to do a project that looks good and has some analogue electronics in it. I will build a system that listens to sound via a microphone, breaks the sound down into frequency bands and displays how loud each frequency band is using a strip of LEDs. It’s a similar idea to a Colour Organ but I want 7 frequency bands and 10 volume levels per frequency band (a total of 70 LEDs).

Continue reading “Project: Spectrum – Beginning”