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

cc2500 spi interfacing with pic

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



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Sep 17, 2014 2:20 pm     Reply with quote

I always forget how to figure out the correct SPI mode and that's why I made a short lookup table:
Code:
// SPI modes overview.
// SPI Mode | MOTOROLA | MICROCHIP | CCS                          | Clock line idle | Data clocked in at
//----------------------------------------------------------------|-----------------|-------------------
//          | CPOL CPHA|  CKP CKE  |                              |                 |
//    0     |  0    0  |   0   1   | SPI_L_TO_H | SPI_XMIT_L_TO_H | low             | low to high edge
//    1     |  0    1  |   0   0   | SPI_L_TO_H                   | low             | high to low edge
//    2     |  1    0  |   1   1   | SPI_H_TO_L                   | high            | high to low edge
//    3     |  1    1  |   1   0   | SPI_H_TO_L | SPI_XMIT_L_TO_H | high            | low to high edge

Howto:
1) Look up the clock level in idle state.
2) Look up if the data is clocked in at the up-going or down-going edge.
3) Find SPI mode in the table.

When I look at page 22 of the referenced datasheet I see:
1) Clock in idle = low
2) Data is clocked in at up-going edge.
==> SPI mode = mode 0
That's different from PCM's example but the same as what you've figured out (CPOL=0, CKE=1), we just don't know if it's the same as what you put down in your program.
jsureshp



Joined: 22 Jul 2010
Posts: 1
Location: chennai

View user's profile Send private message

CC2500 program with pic
PostPosted: Fri Mar 25, 2016 3:52 am     Reply with quote

Hi Namiz,

Please could you share the working program for CC2500 with PIC.
_________________
Suresh
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