cancel
Showing results for 
Search instead for 
Did you mean: 

SPC58: SPI2 with two chip selects

SMay
Associate II

Hi.

I want to use DPI2 located at pins 66 (miso), 68 (mosi) and 112 (clock) to control two different SPI slave devices. Pin 57 (CS0) and pin 64 (CS2) are wired to the respective chip selects.

Then I used the wizards to generate application code for SPI2, using CS0 in hardware. Works like a charm.

But how can I add the second device, also using SPI2 and a different chip select? When I try to duplicate my SPI setting and changing the chip select line, the application stop using the former CS0 completely.

Controller is SPC58EC80E5QMC0, using SPC5studio 6 "asimov".

Thanks.

Edit: SPC5Studio offers options like hardware continuous, hardware discontinuous, software. Why is there no documentation, what those options actually do?

11 REPLIES 11
zambrano.luigi
Senior III

Hi,

as said before, the PWD13 is a unique driver that manages 7 channels. So, if you want to enable the channel 1, you have use the following enable instruction:

pwm_lld_enable_channel(&PWMD13, 1, PWM_PERCENTAGE_TO_WIDTH(&PWMD13,5000), 0, 0, 0);

Waiting for your feedback,

Regards,

Luigi

SMay
Associate II

Aww damn that copy & paste. Sorry, my bad, it is working now. Thanks for your help!