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

SPI setting with 24EP512GU810

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



Joined: 26 Apr 2010
Posts: 56

View user's profile Send private message

SPI setting with 24EP512GU810
PostPosted: Mon May 21, 2012 1:30 pm     Reply with quote

This chip has 4 spi ports. CCS supports 2 spi port operation with spi1 and spi2.

How to define and control other two spi ports by using pin_select and setup_spi etc.

Thanks.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue May 22, 2012 3:15 am     Reply with quote

Either complain to CCS, or read the PIC data sheet, and set the registers yourself.

Mike
kongfu1



Joined: 26 Apr 2010
Posts: 56

View user's profile Send private message

PostPosted: Tue May 22, 2012 11:22 am     Reply with quote

Mike Walne wrote:
Either complain to CCS, or read the PIC data sheet, and set the registers yourself.

Mike


Everyone knows those two options but still post to this group. This place in most cases can provide an answer/solution much sooner than CCS.

Maybe sometimes, no one has same experience and here is the answer from CCS:

All the key words such as spi1, spi2, setup_spi2, spi_read2 , spi_write2 etc can expand to 3 or 4 as data sheet defined. In another word, spi3, spi4, setup_spi3, spi_read4 , spi_write4 etc are all available but NOT documented.

Well, not sure if this feature was tested or not.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue May 22, 2012 11:42 am     Reply with quote

I believe ALL options have to be in the appropriate .h file, or the compiler can't handle them.

Can you find them in the .h file? If not could you modify your copy to avoid direct register manipulation?

Mike
kongfu1



Joined: 26 Apr 2010
Posts: 56

View user's profile Send private message

PostPosted: Tue May 22, 2012 12:01 pm     Reply with quote

Mike Walne wrote:
I believe ALL options have to be in the appropriate .h file, or the compiler can't handle them.

Can you find them in the .h file? If not could you modify your copy to avoid direct register manipulation?

Mike


spi3 and spi4 are declared in device.h file for sure. If build-in functions such as setup_spi4 is not implemented or bug free, direct register manipulation could be only solution. All build-in calls are not necessarily placed in any head file and compiler is OK. Adding additional definition in head file is NOT going to help anything in my opining.

Howard
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue May 22, 2012 3:14 pm     Reply with quote

Quote:

Everyone knows those two options but still post to this group.
My experience is that most of the students looking for free handouts do not know.

Quote:

All build-in calls are not necessarily placed in any head file and compiler is OK
I was only referring to the type of options you were having trouble with (i.e. specific register settings).

Quote:
Adding additional definition in head file is NOT going to help anything in my opining.
I was suggesting that if you modified the .h file you would then be able to code in your usual CCS style, rather than say HiTech

Quote:
All the key words such as spi1, spi2, setup_spi2, spi_read2 , spi_write2 etc can expand to 3 or 4 as data sheet defined. In another word, spi3, spi4, setup_spi3, spi_read4 , spi_write4 etc are all available but NOT documented.
Yes it's true there's often little or no documention in the CCS manual. I find that the only way to get any clue about such features is to refer to the .h file in one hand, the PIC data sheet in the other, using the CCS manual as a crude reference.

Sorry to have put you in the student catagory. No offence meant.

Mike
kongfu1



Joined: 26 Apr 2010
Posts: 56

View user's profile Send private message

PostPosted: Wed May 23, 2012 1:52 pm     Reply with quote

Hi! No need to apologize and explain what you have had in your mind. People knows, trust me. Just be yourself, whatever and whoever.
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