Week Thirteen: Application Programming

This week I prototyped a USB function generator with a PSoC 5LP and a Cocoa app to control it.


PSoC 5LP

I used a PSoC 5LP development board. The PSoC has built in VDACs and IDACs with DMA to allow arbitrary waveforms to be output without CPU intervention. The PSoC has four DACs and many PWM blocks so my final function generator will have several outputs but this week I experimented with just one. I put together a simple schematic in PSoC creator and set up the USB to read in characters and modify the generated signal.


Cocoa Application

Next, I wrote a basic Cocoa app that connects to the board and updates the type, frequency, and amplitude of the output waveform. I also added a basic waveform preview. The current version only support 0-1V output, but I could use a gain stage like in Week Eight to get outputs in a larger voltage range, and add support for scripting to be able to output arbitrary waveforms.