Raspberry Pi Serial Console With MAX3232CPE

In addition to the audio, video, network and USB connectors, the Raspberry Pi also has 26 GPIO pins. These pins also include an UART serial console, which can be used to log in to the Pi, and many other things. However, normal UART device communicate with -12V (logical “1”) and +12V (logical “0”), which may just fry something in the 3.3V Pi. Even “TTL level” serial at 5V runs the same risk.

So in this short tutorial, I’ll show you how to use a MAX3232CPE transceiver to safely convert the normal UART voltage levels to 3.3V accepted by Raspberry Pi, and connect to the Pi using Putty. This is what you’ll need:

  • Raspberry Pi unit
  • Serial port in your PC or USB to serial -adapter
  • MAX3232CPE or similar RS-232 to 3.3V logic level transceiver
  • 5 x 0.1 uF capacitors (I used plastic ones)
  • Jumper wires and breadboard
  • Some type of female-female adapter

The last item is needed to connect male-male jumper wires to RaspPi GPIO pins. I had a short 2×6 pin extension cable available and used that, but an IDE cable and other types ribbon cable work fine as well. Just make sure it doesn’t internally short any of the connections – use a multimeter if in doubt!

The connections on Pi side are rather straightforward. We’ll use the 3.3V pin for power – the draw should not exceed 50 mA, but this should not be an issue, since MAX3232CPE draws less than 1 mA and the capacitors are rather small. GND is also needed, and the two UART pins, TXD and RXD.

Read post

Raspberry Pi arrived today!

A rather long wait ended today, when DHL dropped this little package off at work in the morning. I had placed my Raspberry Pi order in the first 24 hours when they started taking orders (or actually, registrations of interest) from RS Components, but it took about two months for me to receive the invitation to order, and three more weeks for the order to arrive.

Opening up the box, I was greeted with a very small computer, and two small leaflets, a quick start guide and a regulatory and safety pamphlet. The board is really quite small, just a few millimeters larger than a credit card. Two USB slots, HDMI, coaxial and stereo audio plugs and micro-USB for power, plus an ethernet jack.

I ran a quick test to see if everything worked. Initially, there was flicker on my projector (the only device with native HDMI input I currently have), but that turned out to be incompatibility with the HDMI switch I had – without it it worked just fine. I used the premade Debian image on a SD card and it worked perfectly.

Read post

USB HID keyboard with V-USB

There still seems to be a lot of traffic to my V-USB tutorials, so I thought I’d write a short follow-up post on USB keyboards. I already did a USB HID mouse post earlier, so you might want to check that out to understand a bit about HID descriptors and associated V-USB settings (in short, human interface devices send a binary descriptor to PC telling what kind of “reports” they send to the host on user activities).

As a basic setup, you’ll need a working V-USB circuit with one switch and one LED attached. Here, I’m using ATtiny2313 with the LED wired to PB0 and switch to PB1. The ATtiny is using 20 MHz crystal, so if you’re following my USB tutorial series and have that circuit at hand, remember to change that frequency in usbconfig.c before trying this out. Note the cool breadboard header I have, there will be more posts about that one to follow soon!

USB HID keyboard basics

A USB keyboard is a normal USB device, very much like a mouse, but it has an interrupt endpoint, which is used to send keyboard events to the host PC (instead of mouse movements). In this tutorial, I’m using a full “boot compliant HID” specification that can have up to six keys pressed down at a time. The bonus side is that these types of devices receive (at least on Windows, probably on Linux, not on OS X) keyboard LED state changes, so we can do cool things with our device, like I did in my USB password generator, where password generation is triggered by repeated CAPS LOCK presses.

To make the operating system recognize our device as HID keyboard, we need to make mostly the same changes to usbconfig.h as we did in my mouse tutorial. Here’s the overview of things you’ll probably need to change from my USB tutorial series:

Read post

Repairing a Shuttle motherboard with new capacitors

Just a short post today, in case this will save someone’s day like it did my friend’s. He has a small Shuttle PC setup that suddenly stopped working about three weeks ago – the machine seemed to power up, but no picture came to screen. After some googling, he found out that the motherboard of this specific MB+case combo sometimes dies because of failed capacitors. And indeed, the biggest caps on the MB seemed to have a slight bulge on the top. So he called me if I could help him to replace them, to see if that would help.

The first thing to do was of course procure similar caps. The possibly failed models were three 1500 uF, 10V caps, so I got four new ones to replace them.

Removing the old caps

The first task was to remove the old capacitors from the motherboard. Because we wouldn’t be needing them, we used some force and cutters to first remove the capacitors themselves, and then set out to remove the legs with a solder iron. Unfortunately, the lead-free solder had a melting point beyond the number 7 tips of my Weller Magnastat, and no amount of heating was able to remove the legs!

Read post

PCB design with DipTrace

Continuing from part 1 of this ATtiny2313 breadboard header with DipTrace -tutorial, I’ll now go through the PCB design. In DipTrace Schematic Editor, I used File->Convert to PCB (CTRL-B) to get the components and connections exported to PCB Layout tool. Like it’s schematic counterpart, also this tool is quite easy to use.

First I change the grid to 5 mil so each step is half of the 10 mil breadboard hole spacing. I then proceed arrange the components roughly to final layout, and add two 10-pin headers which will plug into breadboard. I then remove some component names which are not sorely needed, and change the location for the remaining ones to the center of the component.

Spacebar is again used to rotate components 90 degrees, and multiple items can be selected with ctrl+click. You probably notice that at some points of the video, the popup-menu options go outside the recording area. Sorry for that! However, I trust you’ll be able to find the correct option yourself if you look at the window that then pops up – usually it’s “xxx properties”, like component or pad properties that I open.

After getting the components more or less to their correct locations, I then draw a board outline (after adjusting the grid to a slightly fines 2.5 mil pitch). DipTrace also has an excellent “Replace pattern” option that lets me change the pattern used for a given component, which I used to replace crystal capacitor patterns with one that takes up less space on silk screen (the distance between pads stays the same, though).

Read post

ATtiny2313 Breadboard Header with DipTrace

Sooner or later there comes a point in your electronics career where it would be nice to have a schematic for the project you are doing. If you have a steady hand and lots of paper to spare, the first option is to draw the schematics on paper. However, computer aided design (CAD) software does have it’s advantages, allowing easy modifications, sharing and later PCB creation.

In this short tutorial, I’ll show how to create a simple schematic using DipTrace, an excellent electronics CAD package that has a free version as well as inexpensive entry-level commercial and non-profit licenses. The circuit I’m doing is a simple ATtiny2313 breadboard header that integrates an ISP programming header, a few capacitors, a reset pullup resistor and a clock crystal, eliminating the need to wire these things every time I start a new project. Additionally, I’m showing how to use DipTrace’s powerful facilities to create new components in literally few minutes. Let’s get started!

Why DipTrace and not Eagle CAD (or some other brand)?

The electronics CAD software, the most often recommended software for beginners is Eagle CAD. The main reasons are probably the rather reasonable pricing and large existing userbase. Also, a lot of open hardware projects share their schematics in Eagle format, and many PCB fabrication shops accept Eagle files directly without conversion to Gerber format.

Read post