View previous topic :: View next topic |
Author |
Message |
alan
Joined: 12 Nov 2012 Posts: 357 Location: South Africa
|
[SOLVED] Using SS in #USE SPI |
Posted: Tue Oct 01, 2013 3:37 pm |
|
|
dsPIC33FJ12MC202
CCS V 5.012
How do I map the SS in the following code:
Code: | #pin_select SCK1IN=PIN_B4
#pin_select SDI1=PIN_B6
#pin_select SDO1=PIN_B5
#use spi(SLAVE, SPI1, MODE=3, BITS=8, ENABLE=PIN_B7, stream=SPI_PORT1)
|
or do I have to use setup_spi and what are the name of the SS pin for pin _select then.
The compiler gives an "Option invalid Wrong SS pin" error.
Regards
Last edited by alan on Tue Oct 01, 2013 10:59 pm; edited 1 time in total |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1346
|
|
Posted: Tue Oct 01, 2013 4:58 pm |
|
|
Remove the enable option and put in a pin_select for the SS:
SS1IN=PIN_B7 |
|
|
alan
Joined: 12 Nov 2012 Posts: 357 Location: South Africa
|
[SOLVED] Using SS in #USE SPI |
Posted: Tue Oct 01, 2013 10:59 pm |
|
|
Thanks jeremiah. That solved it, but I had to keep the ENABLE OPTION, for the compiler to set the register for SS.
Regards
Alan |
|
|
|