DmaSpi for teensyduino 1.20 RC2

Status
Not open for further replies.
I have 16 bit DMA SPI transfers working on t-LC but that is with the SPI library. The DMA async stuff went into the latest beta, but as per Paul I did not add the 16bit transfers which I have working in my private builds:

As for Teensy-LC I don't believe it has CTAR settings that is the the T3.x boards.
To set it up to do 16 bit transfer, you need to update the C2 registers (SPI_C2_SPIMODE) setting to enter into 16 bit mode and then you can usse the DL and DH registers of the SPI registers for the particular port(bus).

Also it is unclear to me how you would use DMA and have it asser/deassert the CS pin. I believe on the LC, that the only hardware CS pin is for when the SPI is running in slave mode. Maybe there is some form of trick, but I am not sure how it easy that part would be.
 
Consider this a sketchy idea: The way DMASPI handles CS is a bit slow, especially for short transfers (which one 16-bit word definitely is). It might be possible to use another DMA channel, chained with the SPI DMA channels, to toggle the CS pin. This limits the whole application a bit since the LC only has 4 channels, but if SPI is the post critical peripheral it might be worth a try. If I were you and in this case I'd probably go for something totally custom and not even try to modify the DMASPI library.
 
Status
Not open for further replies.
Back
Top