LPSPI for SPI-adc and SPI-dac for IMXRT1176

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPSPI for SPI-adc and SPI-dac for IMXRT1176

Jump to solution
293 Views
Jeevan
Contributor IV

Hi team,

We are using external SPI related ADC and DAC for our project.

Which is better approach for establishing communication with SPI protocol (interrupt or polling) because we need only SPI transmission for DACs

0 Kudos
Reply
1 Solution
214 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Jeevan,

Yes, it can still work. Just make sure to initialize the appropriate pin and configure it during the SPI initialization. 

In the case of the lpspi_interrupt_b2b_transfer_slave_cm7 example code from the SDK, you can achieve this by changing "slaveConfig.whichPCS" value from kLPSPI_Pcs0 to kLPSPI_Pcs1:

EdwinHz_0-1725394564329.png

EdwinHz_2-1725394664537.png

BR,
Edwin.

View solution in original post

0 Kudos
Reply
3 Replies
275 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Jeevan,

SPI polling would be a simpler solution, but it can also require a much higher load of work on the CPU. Interrupt increases the complexity of the transmissions but is much better for performance in the CPU. I would depend on how often you expect an ADC/DAC conversion, and how "real-time" you want this conversion to be processes, but I would recommend using the interrupt method, and basing your code on the example project we provide in our SDKs.

BR,
Edwin.

0 Kudos
Reply
233 Views
Jeevan
Contributor IV

Hi @EdwinHz ,

Thank you for your valuable information.

Just had one query.

Will the SPI communication work from eval board to eval board if chip select 0 selected on one board and chip select 1 selected on another board.

Board connection:

Eval board 1 <--> Eval board 2

CS0 <-> CS1

Clock <-> Clock

MOSI <-> MISO

MISO <-> MOSI

GND <-> GND

0 Kudos
Reply
215 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Jeevan,

Yes, it can still work. Just make sure to initialize the appropriate pin and configure it during the SPI initialization. 

In the case of the lpspi_interrupt_b2b_transfer_slave_cm7 example code from the SDK, you can achieve this by changing "slaveConfig.whichPCS" value from kLPSPI_Pcs0 to kLPSPI_Pcs1:

EdwinHz_0-1725394564329.png

EdwinHz_2-1725394664537.png

BR,
Edwin.

0 Kudos
Reply