2025-09-02 5:35 PM - last edited on 2025-09-03 1:51 AM by Andrew Neil
Hi,
I'm trying to do 3-WIRE SPI communication with DAC60501,
but no matter what I do, the output value doesn't change.
I checked the waveform with a scope and it all was OK.
The first falling edge of SYNC starts the operation cycle --> CPHA= 1 Edge
uint8_t aTxBuffer[3] = { 0x08, 0x7F, 0xAA }; --> command = DAC_DATA, value = 0x7FA (12bit)
I set up CUBE MX as above.
Is there anyone who can tell me why it doesn't work?
Thank you in advance.
2025-09-03 1:50 AM
welcome to the forum.
Some more details are needed - please see How to write your question to maximize your chances to find a solution for best results.
In particular, Please show your schematic.
@AndersonKKK wrote:I checked the waveform with a scope and it all was OK.
Please show the scope trace.
If your scope has a screenshot facility, please use it - this will be far better than trying to photograph the screen!
Note that the DAC60501 is a TI product - nothing to do with ST:
https://www.ti.com/product/DAC60501
If your SPI waveforms are, indeed, correct then the problem must be elsewhere than the STM32.
You should post your schematic & trace on the TI forums - they will be able to see if you do, indeed, have everything correct for their product:
https://www.ti.com/product/DAC60501#support-training
Include a link there to this thread, and give a link here to your TI forum thread - so that everyone can see the whole story.
2025-09-03 4:29 AM
Just one remark:
the 60501 is a 12bit DAC
Your 0x7AA are more than that.
12Bit (left allgin) is max 0x7FB0 the right 4 bit should
be 0.
Try 0x3FB0 as value....
and as Andrew tell you: more information, schematic etc.
padawan
2025-09-03 7:53 AM
I haven't used CubeMX, but over here it's said that "N Edge" means "Captured on the Nth edge".
For CPOL=0 (low) the "falling edge" is the second, so I think you want "2 Edge" here.
[There have been times when, unable to decode an inscrutable data sheet, I just tried all the SPI modes (there are only 4) to see which one "worked".]