PDA

View Full Version : 4 DAC channels from a single PIC



The Master
- 20th January 2016, 15:17
Hi, I'm working on a project that requires 4 audio outputs from DACs but I can't find any suitable.

DAC requirements:-
8-bit minimum resolution
16-bits of data per channel max. My PIC only has an 8-byte SPI buffer
3.3V
Each channel must be aligned to an 8-bit boundary

My main concern is the amount of clock cycles the PIC can use communicating with the DACs. Ideally I would like to queue all of the data into the PIC's SPI buffer and exit the interrupt routine.
I can pulse the latch pin at the start of the next interrupt but all of the DACs I've seen require the CS line to be toggled between each message. Even a single DAC with 4 channels requires CS to be toggled 4 times.
I don't have enough clock cycles to wait in the interrupt while the data is sent or to keep jumping in and out of interrupts between each byte.

Does anyone know of a 4 channel DAC that will allow me to simply shift 4 bytes into it? Failing that, I would be happy with 4 x single channel DACs that can be daisy chained so they don't require individual CS control.

I've also considered a hardware solution. Is there such thing as an SPI splitter that would allow me to shift 4 bytes into it and have each byte shifted out of 4 separate data lines?

Jerson
- 20th January 2016, 16:55
Not sure if this is helpful, but,....

What if you daisy chain 4 HC595 or similar serial - parallel shifters? Each 595 in turn could drive a R-2R ladder or simply jam its 8 bits into a parallel loaded single DAC.

HenrikOlsson
- 20th January 2016, 17:40
Out of curiosity, which PIC has an 8-byte SPI buffer?

/Henrik.

The Master
- 20th January 2016, 21:25
Jerson: That's a good idea. As long as I can somehow clock the data into the shift register then toggle a line to load the current state into the DAC then that should work perfectly (I will do some reading on this). I can get hold of parallel DACs easier too! Thanks :)

Henrik: I work with PIC24FJ64GA002/PIC24FJ64GA004 chips. It's possible to fire 9 bytes at the SPI module in one go. The first byte moves straight to the shift register leaving all 8 slots in the FIFO available.

HenrikOlsson
- 21st January 2016, 06:12
Ah, that's what I suspected, not an 8-bit PIC. To bad, that could be useful with PBP.
Thanks!
/Henrik.

Ioannis
- 21st January 2016, 19:23
To bad, that could be useful with PBP

One day dream might come true...

Ioannis