Sign In | Register |
0

SPI to SSP

Technical Question - Created by Drew on 6/27/2017 4:10:19 PM
Actions

Drew

Posted
3 years ago

Hi there. I am working through the SPI example and have found that port 0 works great, but when I switch the port to 1 (on the same pins), the SSP doesn't seem to be working. Is there anything else I need to account for while using the SSP ports instead of the SPI within your SDK? 

Thanks!

Tyler

DZX Support
Posted
3 years ago

Hi Drew,

There is nothing special within the SPI driver to use the other SSP ports (number 1 and 2). You do need to change the pin configuration for the SCK, MISO and MOSI pins within the PINSEL registers. This is can be done using PIN_SetFunction() from mcu_pin.c/.h. 

For example, assuming you're using P0.15, P0.17 and P0.18, you should have the following somewhere in your application.

// Configure pins for SPI peripheral
PIN_SetFunction(P0_15, 3); // SCK pin
PIN_SetFunction(P0_17, 3); // MISO pin
PIN_SetFunction(P0_18, 3); // MOSI pin​

The following is changed to configure the same pins for the SSP0 peripheral instead.

// Configure pins for SSP0 peripheral
PIN_SetFunction(P0_15, 2); // SCK pin
PIN_SetFunction(P0_17, 2); // MISO pin
PIN_SetFunction(P0_18, 2); // MOSI pin

Best Regards,

Tyler

Drew

Posted
3 years ago

That was my problem.


Thank you very much for the support. 

Reply