My Pi Description

My Experiences With the Raspberry Pi -- Tracking My Learning -- My Pi Projects

Monday, July 22, 2013

Gertboard - What the Heck! Why are those LEDs Flashing On and Off?

So, I unpacked the Gertboard, attached the stand-offs, connected it to the Raspberry Pi, and applied power.
And - All twelve LEDs on the Gertboard lit, then some went off, then different ones just started to flash on and off. When I touched the metal shell of the Ethernet, USB, or HDMI connectors all of the LEDs went off.
THAT'S JUST WRONG. ALL LEDs SHOULD BE OFF UNLESS COMMANDED TO BE ON.
I looked at the schematics to find if there was a fault with the Gertboard. Did I find a problem? Yes a DESIGN problem. Refer to Figure 8 on page 15 of the "Gertboard User Manual" (version 2 manual). I have recreated that figure here except for the 10K pullup resistor. I'll talk about that below the diagram.
Buffer and LED circuit. Represents one of twelve circuits
Now here is where things get a bit tricky. If you look at that figure 8 in the manual, you see a 10k resistor connected between the input of the lower buffer and 3.3V. Why doesn't my diagram above show that resistor? When I purchased my Gertboard, only version 1 of the user's manual was available. I didn't know there was a new version until I started to write the post before this one. The version 1 manual, and schematics did not show this resistor. I did not know these resistors (R201 - R212) even existed on my board. Even so, the combination of the 10k pullup resistor and the 74HC244 buffer chip did not do the job. The 10k was not strong enough of a pullup (10k is too high a value) to prevent the LEDs from randomly turning off when no jumpers or wires connect the buffers to other circuitry.
The version 1 manual did talk about the problem. It said, "Depending on the type of 74xx244 buffer chosen, the LED could behave randomly if the port is not driven properly. In that case it may easily switch state, switching on or off with the smallest of electronic changes, for example, when the board is simply touched." That was what I saw even with the 10k pullup resistor. The text says that you need to drive the port properly. If your project only needs one port, then the other eleven are not being driven at all. Is it proper operation to have to look at eleven LEDs flash on and off? Version 2 of the manual changes that information to: "The resistor on the right side of Figure 8 is a pull-up. If it were not there, the LED would turn off and on with the smallest of electronic changes, for example, when the board is simply touched. Turning the LED on when it is not being driven prevents this seemingly random behaviour and also serves as an indicator that your Gertboard is receiving power properly. Note that if the output jumper is installed but the ‘Raspi’ point is not driven, the random behaviour will return."
Even if the pullups worked and the LEDs connected to the unused buffers turned on, that to me, is not proper operation. If a circuit is not being used, the LED should be OFF. The manual says that the LEDs being on indicates "that your Gertboard is receiving power properly". Do we need up to 12 indicators that the board is under power?
There is another issue when no jumper or wire connects the input of a buffer to anything else. The buffer IC is a CMOS device. These devices are highly susceptible to destruction by static electricity. If the inputs are not connected to anything except to a connector pin, a pullup resistor is always connected to the input. This provides protection when the connector is not connected to anything else. Often an IC has multiple, identical, circuits. For example, the 74HC244, has eight buffers. If your circuit only needs 7 buffers, the eighth one will always have a pullup resistor (or, if you are the circuit designer, you get fired). For this purpose, a value of about 100k is acceptable. You probably have noticed that electronic circuit boards, like the Gertboard and the Raspberry Pi, are packed on foam and in one of those ubiquitous black bags. That foam and that bag are to prevent static electricity from reaching the board and blowing up ICs when the board is not connected into a circuit.
The Gertboard greatly exacerbates this static problem because of the way it is used. The human body is a great source of static electricity discharge. You, the user of the Gertboard, will be handling the board, connecting and disconnecting the Pi, and installing and removing jumpers, wires, and devices. The board does not have to be under power for damage to occur.
OK, there are 10k pullup resistors on the board - in fact there are 12 of them. However, there are TWENTY FOUR BUFFERS, not just 12. In the figure above, the input of the buffer on the bottom, the one that connects to the LED has the 10k pullup - so should be protected from static discharge. But, what about the upper buffer? According to the schematic it looks like the input of that buffer connects to the Raspberry Pi. That is only correct if you use a wire and connect that point to the Pi (make a connection between a J2 and a J3 pair of pins). If you don't, that input is not connected to anything except a connector pin, which is not connected to anything else. Don't forget that this diagram represents one of 12 circuits. Chances are that you will not always be using all 12 of these circuits in your projects.
My next blog post will tell what I did about this problem.

No comments:

Post a Comment