Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
Posted: Wed Sep 17, 2014 2:20 pm
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
CC2500 program with pic
Posted: Fri Mar 25, 2016 3:52 am
Hi Namiz,
Please could you share the working program for CC2500 with PIC. _________________ Suresh
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