HELLO!!
I have problems loading an SPI example, the spi_polling_b2b_transfer_master.c
It always has errors and I don't understand why, I am trying to do something similar with a DAC that works by SPI, I try to send an array of data as it is done in the example, but it doesn't work either.
If someone knows why the example doesn't work correctly, and how to send an array of data from the SPI, please let me know.
Thank you very much.
Best regards.
I'm using the MCP4821 DAC, which I don't know if it might be incompatible or something.
> If someone knows why the example doesn't work correctly, and how to send an array of data from the SPI, please let me know.
SPI is a loosely defined protocol, with variants in e.g. clock polarity, trigger edge, and clock speed.
Your SPI master setup (MCU) need to match the requirements of the slave (DAC).
As suggested, take a logic analyser or scope and compare the signal form with the DAC datasheet.
And I hope you are aware that SPI is a synchronous protocol, but the slave response is deferred by at least one transfer cycle.
@frank_m WHAT FUNCTION SHOULD I USE TO TRANSMIT IN SPI WITHOUT NEEDING A RESPONSE? How can I set the clock to 16 pulses?
> WHAT FUNCTION SHOULD I USE TO TRANSMIT IN SPI WITHOUT NEEDING A RESPONSE?
I suppose you mean, without regarding the response.
You can either read it out to clear any interrupt/FIFO flag, and discard the value. Or configure the SPI FIFO to ignore RX data (FIFOWR, bit 22 = RXIGNORE).
The standard SPI interface contains a write (MOSI) and a read (MISO) line, from the master's view. Each clock pulse cycles one bit out on MOSI and one bit in on MISO simultaneously.
> How can I set the clock to 16 pulses?
The same SPI config register (FIFOWR) contains a length field, bits 27..24. A 16-bit transfer corresponds to a value 0xF for this field.
Check the user manual, SPI section for details. (UM10912, sect. 26.6.14 for the LPX546xx), I don't know the associated SDK functions, I haven't used them yet.
Hello Nadia,
To help you please provide more information:
1) Which chip?
2) Does it have issue when directly run demo?
3) What about the detail issue about doesn't work?
4) You can use Logic measure signal .
BR
Alice
@Alice_YangLPC54628,When I run the demo with the test board I get the messages that there has been an error, the printf's of the program that say that there has been an error I mean.
I am not modifying the demo.
I'm using the MCP4821 DAC, I don't know if it might be incompatible.