CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

[SOLVED] Using SS in #USE SPI

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
alan



Joined: 12 Nov 2012
Posts: 357
Location: South Africa

View user's profile Send private message

[SOLVED] Using SS in #USE SPI
PostPosted: Tue Oct 01, 2013 3:37 pm     Reply with quote

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: 1322

View user's profile Send private message

PostPosted: Tue Oct 01, 2013 4:58 pm     Reply with quote

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

View user's profile Send private message

[SOLVED] Using SS in #USE SPI
PostPosted: Tue Oct 01, 2013 10:59 pm     Reply with quote

Thanks jeremiah. That solved it, but I had to keep the ENABLE OPTION, for the compiler to set the register for SS.

Regards
Alan
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group