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 CCS Technical Support

How can I set SPI pin_x at PIC24FJ256GB106

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



Joined: 05 Aug 2009
Posts: 37

View user's profile Send private message MSN Messenger

How can I set SPI pin_x at PIC24FJ256GB106
PostPosted: Tue Jan 12, 2010 10:17 pm     Reply with quote

My PIC is PIC24FJ256GB106.
How should I plan "PRn Pin" for Hardware ?
24FJ256GB106 have three hardware SPI inside.
How does CCS plan the code edit ?

The CCS index say ~
Code:

#use spi(DI=PIN_B1, DO=PIN_B0, CLK=PIN_B2, ENABLE=PIN_B4, BITS=16)
// uses software SPI

#use spi(FORCE_HW, BITS=16, stream=SPI_STREAM)
// uses hardware SPI and gives this stream the name SPI_STREAM

But ~ When I use hardware SPI and compiler.

CCS have error about "not valid for H/W" <-----

I hope SPI plan use ~
Code:

#define   SDI   PIN_B4
#define   SDO  PIN_B5
#define   SCK  PIN_B8
#define   CS    PIN_B9

How can I write the CCS code? 

Help me, please .... Thanks everybody Very Happy Very Happy Very Happy
Very Happy
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Jan 13, 2010 1:05 am     Reply with quote

PIC24 with remappable I/O pins are supported by #pin_select statements in PCD. Examples have been given in CCS Forum.
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