Soekris R-2R: Interfacing to an Arduino

The Soekris dam1021 has a serial port (J10).J10-serial
This serial port serves a number of purposes:

1) It is used for uploading firmware updates via the uManager prompt.
2) It is used for uploading filter values via a software utility (not yet released).
3) Outputting info on currently selected Input, Sampling Rate and Volume level.
4) Controlling things by receiving commands. Up to now, we can select Input and change the Volume. More commands might be added in the future (or already exist, but are not yet documented by Soren).

In order to do all those things, one has to interface to this serial port. In this post I detailed how to interface a computer to this port (so as to perform a firmware upgrade). Now it is time to do the same for a microcontroller, say an Arduino.

The problem is, microcontrollers use different voltage levels compared to the “classic” RS-232 serial protocol. In order to make these different things talk to each other, we need to use what is called an “RS-232 Receiver / Transmitter” IC. Such ICs are pretty commonplace, since they are found inside of most devices that come with RS-232 interfaces. The “classic” IC that is used is the Maxim MAX232. It is very low-cost but it is also an old design, requiring 5V (instead of 3.3) and 5 x 1μF capacitors. There is a much newer version of the chip, the MAX3232, operating with a voltage between 3V and 5V and requiring much smaller caps (0.1μF), but it is not as widely available as the MAX232. Since I was in a hurry to get things up and running, I chose what I could find locally in stock: a MAX232.

MAX232

This meant that I had to power it with 5V and use 1μF tantalum or ceramic capacitors, but what the heck. I was in a hurry.

After reading the MAX323’s data sheet I ended up with this:

RS-232-interface_v2_bb
(click on the picture for a higher resolution version)

You will notice that I am using Serial3 of the DUE to talk to the DAM DAC. Any serial port could be used, but I chose Serial3 because it was practical – it will be easy to route these specific pins on the shield that I am designing.

Once I verified that the above circuit worked, I built it on perfboard to keep handy:

MAX232_interface

The above circuit works in general but has some trouble with the DAM DAC. It works just fine upon power up but at some point loses communication with the DAC. The only way to restore communication is to power cycle the DAC. I am not sure what the problem is, but I suspect that it has to do with the power management features of the ICL3221 chip used on the DAM. I have ordered an ICL3221 to use in place of the MAX232, in hope that everything will work fine when I use this (at least in theory) fully compatible IC.

Stay tuned.