What does the SPI communication you have to do look like? Can you send a number of samples at one time to the chip, and will it 'play them back' at an independent, fixed speed, or do you have to send it a new SPI sample precisely in time with the sample rate?
Hello Sprite,
Thanks for the response again. The SPI communication will require a fixed rate. The DAC output is updated when the data is finished being written to the DAC's register. (CC1120 CFM Mode - I'm setting up the FM deviation manually to send an analog FM signal with a digital RF transceiver). Therefore, I have to send the data at a fixed rate. The DAC can provide a GPIO line to toggle when the new sample is required from the ESP32 to help assist with timing.
The DAC will permit me to burst write to the register so I don't have to keep initializing new SPI transactions for each DAC update. I thought about setting the SPI data rate so that it will equal my required sample rate, but the amount of data I'll need to pre-assemble for a single transaction seems a bit daunting to me. Let me run some numbers by you and you can tell me if you think I'll have RAM issues in the future or if there is a method to stream data to the SPI buffer while it's writing...
First let me provide a bit of background, I'm assembling an APRS packet which utilizes BELL202 modulation. BELL202 is a janky AFSK method of sending binary data over a voice channel which consists of sending two different tones 1200Hz and 2200Hz with a data rate of 1200bps. Therefore, we'll be switching between the tones at 1200Hz.
If we decided to pre-assemble an array with every value SPI value we need to send to the DAC, it seems to get pretty hairy pretty quick.
For example, if we do a not-so-conservative estimate and say I need to send a packet consisting of 200 bytes (big packet).
Our Fs is fixed by our fastest tone and the resolution of our DAC. I calculate Fs based on 2 possible resolutions 5 bits and 7 bits.
Fs = (2200Hz * 2^7) = 281.6kHz
Fs = (2200Hz * 2^5) = 70.5kHz
We'll use 5 bits for this example...so I need to send 70kBytes per second. A pretty easily achievable SPI rate
The problem is this: If the packet is 200 bytes and the data rate is 1200bps, we'll be sending data for 200*8/1200 = 1.33s. 1.33s*70.5kHz = 94,000 bytes I'll need to pre-allocate
Please let me know if I can provide any additional information or if if I royally bodged any math!