We recently received a Red Pitaya, a successfully funded kickstarter campaign for open source instrumentation. The Red Pitaya has a Dual core ARM Cortex A9+ FPGA with 4GB of ram, with the circuitry to handle fast analog inputs, analog outputs, and digital GPIO. It is similar to the Parallella in that it shares the same Zynq processor, but includes a nice analog front-end for signal capture and measurements. The concept of the Red Pitaya project is to build a software platform on top of a powerful hardware platform capable of measuring precise voltages, taking advantage of the hardware in various ways. Similar to an app store, except for measurement devices.
Since the Red Pitaya has an FPGA and a fully functioning Linux environment, we can take full advantage of the hardware by writing custom VHDL code for very fast response times. The Red Pitaya has a 16 pin port dedicated for GPIO for the FPGA, which can be used to easily integrate the Red Pitaya with test fixtures for example.
We envision leveraging the Red Pitaya in a variety of applications where a simple ARM, FPGA, or PC wouldn’t be sufficient independently. In the example of an automated PCB test fixture, this platform provides 16 pin GPIO manipulation with 6 channels of oscilloscope measurements with 6 channels of analog outputs. By utilizing a bit of custom VHDL code for the FPGA, we could quickly exercise a variety of subsystems to determine if a circuit is performing as expected. Since the Red Pitaya can also be connected to the network, we can perform full signal capture over TCP/IP, which would allow for the heavy signal processing to be offloaded to a more powerful computer along with data collection and logging. This provides a very powerful and reusable platform for test. For example, since all of the measurements are taking place on the Zynq processor, the 6 analog measurements can be used as parameters in a PID control loop, which can then trigger additional VHDL logic in response to a voltage reading which is higher than expected.
With the Red Pitaya’s fairly unique architecture, the barrier to high speed analog, digital, and logic manipulation and analysis just became a lot lower. Speed and efficiency is highly valued for the projects we run at Sparx.
One of the first hurdles to overcome was connecting the Red Pitaya to the network. To do this, I connected to its serial port and looked to see what binaries were available in /bin and /sbin.
I discovered that ifconfig was present, but not dhclient. I also discovered a strange flag in /opt/etc/network/interfaces:
iface eth0 inet dhcp udhcpc_opts -t7 -T3
That’s how I discovered that /sbin/udhcpc could also be used for getting a dynamic IP. So after bringing up the interface, I can now get an IP address.
ifconfig eth0 up udhcpc -i eth0
The message on device startup indicated that /opt/etc/init.d/rcS can be modified to run user commands on startup. So if I run /opt/sbin/rw to switch the filesystem to read-write, I could add any necessary commands to configure the network interface to automatically connect. After initially editing /opt/etc/init.d/rcS to include bringing up the interface and getting a DHCP IP, I found that I no longer need to have those lines. I suspect that acquiring DHCP while the filesystem was in read/write mode, allowed resolv.conf to be updated with our nameserver (thus, it can get an IP address every time).
We configured the oscilloscope probes to the HV, +/- 20 V setting.
After connecting to it through the Red Pitaya Discovery Portal, I was finally able to connect to the oscilloscope:
As you can see in the Measure Panel, the measurements are averaging 3.073V for the 3.3V signal, and 13.0V for the 12V signal. I found that reducing the probe attenuation to 1x seemed to help the error a bit, but there was still a significant offset.
Improving the accuracy is possible through calibration, but for general ballpark measurements, the current accuracy may be good enough.
We are just starting to work with this hardware, so I’m sure we’ll gain a lot more insight soon on how best to utilize this new hardware. So far, the Red Pitaya is turning out to be a great networked tool that offers a lot of capabilities that a traditional oscilloscope, signal generator, or logic analyzer traditionally don’t have, so its exciting to see where we can take this tool. As is usual here, we’ll push this hardware to its limits.