Not applicable
Oct 04, 2017
07:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 04, 2017
07:27 AM
Hello,
I want to manage two Slave devices by means of SPI protocol with my XMC4200 as Master. These two devices are connected to P0.7 and P1.0, respectively. Both pins are availabre for SELO0 in the XMC4200.
In the Dave App I select P0.7 as SELO0. During the main program I want to change the SELO0 to the other pin P1.0 to manage both devices when I need.
I need help with the neccesary intructions to change the SELO0 pin P0.7 to P1.0 and viceversa.
Regards,
Victor
I want to manage two Slave devices by means of SPI protocol with my XMC4200 as Master. These two devices are connected to P0.7 and P1.0, respectively. Both pins are availabre for SELO0 in the XMC4200.
In the Dave App I select P0.7 as SELO0. During the main program I want to change the SELO0 to the other pin P1.0 to manage both devices when I need.
I need help with the neccesary intructions to change the SELO0 pin P0.7 to P1.0 and viceversa.
Regards,
Victor
Labels
1 Reply
Oct 10, 2017
05:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 10, 2017
05:59 AM
Hi,
Did you try something like below?
SPI_MASTER_EnableSlaveSelectSignal(&SPI_MASTER_0, SPI_MASTER_SS_SIGNAL_0);
SPI_MASTER_Transmit(&SPI_MASTER_0, data, DATA_LEN);
while(SPI_MASTER_0.runtime->tx_busy);
SPI_MASTER_DisableSlaveSelectSignal(&SPI_MASTER_0);
SPI_MASTER_EnableSlaveSelectSignal(&SPI_MASTER_0, SPI_MASTER_SS_SIGNAL_1);
SPI_MASTER_Transmit(&SPI_MASTER_0, data, DATA_LEN);
while(SPI_MASTER_0.runtime->tx_busy);
SPI_MASTER_DisableSlaveSelectSignal(&SPI_MASTER_0);
Regards,
Jesus
Did you try something like below?
SPI_MASTER_EnableSlaveSelectSignal(&SPI_MASTER_0, SPI_MASTER_SS_SIGNAL_0);
SPI_MASTER_Transmit(&SPI_MASTER_0, data, DATA_LEN);
while(SPI_MASTER_0.runtime->tx_busy);
SPI_MASTER_DisableSlaveSelectSignal(&SPI_MASTER_0);
SPI_MASTER_EnableSlaveSelectSignal(&SPI_MASTER_0, SPI_MASTER_SS_SIGNAL_1);
SPI_MASTER_Transmit(&SPI_MASTER_0, data, DATA_LEN);
while(SPI_MASTER_0.runtime->tx_busy);
SPI_MASTER_DisableSlaveSelectSignal(&SPI_MASTER_0);
Regards,
Jesus