Instruments4Chem

High Performance, Low Cost…

The Parallax Propeller Activity Board

On this page i’ll describe a project that links a program running on a Propeller chip back to LabVIEWTM.

The project involves working with a LabVIEWTM run-time executable - exposing user data (that the Propeller is very good at acquiring) to LabVIEW’s powerful signal processing, analysis and graphics tools.

The board we will use for this project is called the Propeller Activity Board (see image opposite). Below the white prototyping area you will notice a single row header - this has some ground pins, 2 DAC outputs and 4 ADC inputs - see the description of item 8) in the image.

This project allows the user to acquire data (at a nominated sampling interval) from any one of the ADC channels on the Activity Board into an on-chip memory buffer - and then dumps this buffer up to LabVIEWTM for graphical display and signal processing.

The Propeller chip has sufficient on-board memory for up to 15000 data points at a maximum sampling rate of 125 kHz (8 us/pt).

STEPS


To experiment with this project you’ll need to download the latest Propeller Tool software and also purchase a Propeller Activity Board. The software downloads page describes the steps you’ll need to follow prior to connecting your Activity Board. From here on i’ll assume that you already know how to use the Propeller Tool to download SPIN programs onto the Propeller Activity board.

Start by downloading the distribution.zip file - this contains both a LV2013 runtime executable and a spin file to run on the Activity Board. The executable will invoke the Activity Boards’s on-board ADC (a Texas Instruments ADC124S021) to measure and display voltages applied to any one of its 4 input channels.

To use the distribution, you'll need to do the following :

1) Download and install the LV2013 runtime engine (RTE) from the NI website (see here for information about this). Note that this is not the latest version of the RTE (as this project was developed some time ago). Do ensure you get that particular version of the RTE !!

2) Next, unzip distribution.zip. In the unzipped distribution folder, the LV runtime executable has a file extension .abc - you’ll first need to change that back to .exe. You’ll notice a few other files in the distribution folder - be sure to leave them all in the one place as they are essential for LabVIEWTM to work properly. The spin file can be moved wherever you like, if desired.

3) Now connect up your Activity Board to your PCB and download/launch Activity_Board_v1(230400).spin.

4) Once that’s been done, run ActivityBoard_LV2013_ADC_v1.exe - if all is well you should see it load up with the screen capture shown below. Clicking on the arrows at the top left of screen will launch the executable – the single arrow icon means run the vi once, and the circular arrow icon means run the vi continuously. Execution can be ended at any time by clicking on the red stop button.

5) While things are running the yellow LED at DAC0 should come on during ADC activity, and the blue LED near the mini USB will indicate data transfers back to the PC.
Notes :

On start-up, the default settings in the LabVIEWTM runtime executable assume the voltage source you’d like to measure is connected to the Activity Board’s channel #2 input.

There is also provision for summation averaging of the ADC readings - controlled by the #Samples field - the default setting here is 8. When summation averaging is operative (#Samples > 1) the requested number of samples are co-added into an accumulator “on-the-fly” and once completed, the accumulated result is stored into the waveform buffer.

The on-board ADC is a 12 bit device, while the accumulator and waveform buffer entries are 16 bit words. This means that a total of 24 = 16 samples can be co-added before a potential overflow occurs. Once the data is back in LabVIEW, the summed counts are divided by the #Samples to give average counts that are displayed in the main graphics pane.

The Dwell(usec) field allows the user to specify the interval between ADC samples. Note that if summation averaging is invoked, the effective dwell time is the value specified in the Dwell field multiplied by the #Samples being taken. In any event, the effective sampling rate is displayed in a text box on screen.

The LV build/spin code assumes a baud rate of 230400 for the data transfers. That’s set by a baud rate constant in the .spin file but this should not be changed !

For Mac users, the runtime executable supplied in the distribution should also function on a Mac too, running in emulation mode.

You'll find you can edit graph x and y scales and input text fields on-the-fly in the LabVIEW front panel using standard point and click/text editing methods.

The runtime executable also displays a histogram of the ADC readings as well as the Fourier transform of each recorded dataset. What makes LabVIEWTM so attractive is that additional features like this are trivial to add in just a few minutes !

The SPIN code is straightforward, with a short preamble launching a COG that runs PASM. The code implements a serial port-based monitor/dispatcher running on the Activity Board that responds to various command strings that are sent from the LabVIEW host. You’ll find those commands documented in the code. For example, LabVIEW sends the string C2, to set the ADC channel # to 2, with the comma being used as a sentinel character.

Note that there are a couple of things in the code that I’m currently working on (DAC support, and addition of a TSL235 light-to-frequency converter) - but these are not being used here. I’m planning to release an updated version of this project in the future that more fully exercises the many available features on the Activity Board.