Using a MCP4921 or MCP4922 as a SPI DAC for Audio on Raspberry Pi

  • Post author:
  • Post category:Gang Scan

I've been playing recently with using a MCP4921 as an audio DAC on a Raspberry Pi Zero W, although a MCP4922 would be equivalent (the '22 is a two channel DAC, the '21 is a single channel DAC). This post is my notes on where I got to before I decided that thing wasn't going to work out for me. My basic requirement was to be able to play sounds on a raspberry pi which already has two SPI buses in use. Thus, adding a SPI DAC seemed like a logical choice. The basic circuit looked like this: Driving this circuit looked like this (noting that this code was a prototype and isn't the best ever). The bit that took a while there was realising that the CS line needs to be toggled between 16 bit writes. Once that had been done (which meant moving to a different spidev call), things were on the up and up. This was the point I realised that I was at a dead end. I can't find a way to send the data to the DAC in a way which respects the timing of the audio file. Before I had to do small writes…

Continue ReadingUsing a MCP4921 or MCP4922 as a SPI DAC for Audio on Raspberry Pi

Introducing GangScan

  • Post author:
  • Post category:Gang Scan

As some of you might know, I am a Scout Leader. One of the things I do for Scouts is I assist in a minor role with the running of Canberra Gang Show, a theatre production for young people. One of the things Gang Show cares about is that they need to be able to do rapid roll calls and reporting on who is present at any given time -- this is used for working out who is absent before a performance (and therefore needs an understudy), as well as ensuring we know where everyone is in an environment that sometimes has its fire suppression systems isolated. Before I came along, Canberra Gang Show was doing this with a Windows based attendance tracking application, and 125kHz RFID tags. This system worked just fine, except that the software was clunky and there was only one badge reader -- we struggled explaining to youth that they need to press the "out" button when logging out, and we wanted to be able to have attendance trackers at other locations in the theatre instead of forcing everyone to flow through a single door. So, I got thinking. How hard can it be to build…

Continue ReadingIntroducing GangScan

End of content

No more pages to load