View previous topic :: View next topic |
Author |
Message |
kongfu1
Joined: 26 Apr 2010 Posts: 56
|
SPI setting with 24EP512GU810 |
Posted: Mon May 21, 2012 1:30 pm |
|
|
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
|
|
Posted: Tue May 22, 2012 3:15 am |
|
|
Either complain to CCS, or read the PIC data sheet, and set the registers yourself.
Mike |
|
|
kongfu1
Joined: 26 Apr 2010 Posts: 56
|
|
Posted: Tue May 22, 2012 11:22 am |
|
|
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
|
|
Posted: Tue May 22, 2012 11:42 am |
|
|
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
|
|
Posted: Tue May 22, 2012 12:01 pm |
|
|
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
|
|
Posted: Tue May 22, 2012 3:14 pm |
|
|
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
|
|
Posted: Wed May 23, 2012 1:52 pm |
|
|
Hi! No need to apologize and explain what you have had in your mind. People knows, trust me. Just be yourself, whatever and whoever. |
|
|
|