I've been reading through different messages on the board and I'm trying to figure out how to do non-DMA high speed transfers over SPI.
The board does NOT have the NSS pin running to the /SYNC pin of the DAC I am using, so I have to software toggle the SYNC pin after every 16-bit transfer.
As probably expected, using spiSend is slow for this.
What I don't understand is spiPolledExchange wants data back, but I the DAC has no communication pin to attach to MISO so how do I tell it nothing is coming back in? Not sure I understand how to work in this mode.
Rick
SPI HS single transfer question
Moderator: RoccoMarco
Re: SPI HS single transfer question
It's inherent in the way SPI works that you can both send and receive data at the same time.
If you have no data to receive, just ignore it.
If MISO is brought out, just tie it to a known level (as good wiring practice). If there's no MISO pin configured, I imagine the device would do this internally.
If you have no data to receive, just ignore it.
If MISO is brought out, just tie it to a known level (as good wiring practice). If there's no MISO pin configured, I imagine the device would do this internally.
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: SPI HS single transfer question
Hi,
spiPolledExchange() is the best solution for small frequent transfers. As steved described, just ignore incoming data.
Giovanni
spiPolledExchange() is the best solution for small frequent transfers. As steved described, just ignore incoming data.
Giovanni
-
Rick Burnett
- Posts: 150
- Joined: Tue Jan 08, 2013 2:20 pm
Re: SPI HS single transfer question
Excellent, I didn't realize the data came back at the same time, is the full-duplex mode? In any case, implemented it last night and the performance is great.
Re: SPI HS single transfer question
SPI is implemented using a shift register, generally 8-bit on processors.
So as you clock data out, you inherently can clock data in, and save every 8 clock cycles if desired.
So as you clock data out, you inherently can clock data in, and save every 8 clock cycles if desired.
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: SPI HS single transfer question
SPI by its nature inputs one bit and outputs one bit on a clock edge, there is no RX and TX, it is the same thing, the two ends of a shift register.
Edit: LOL, one minute late.
Giovanni
Edit: LOL, one minute late.
Giovanni