CC1120: CC1120 SPI modes

Part Number: CC1120

I'm using the CC1120.  Works great on our RF project.  I have recently added a SD card on the SPI bus, which is causing some quirkiness with the RF chip.  I have the RF chip using SPI mode 0.  I think I remember way back that mode 0 was the preferred mode.  Not sure whether that is correct or if mode 3 can also be used.  However, what I am seeing is that if I use the SD card (also in Mode 0), then for about 20 seconds or so after an SD transaction and subsequent CS back high, MISO still gets held high and prevents the RF chip from accessing the bus.  After 20 seconds, the bus is released and things work OK.  I am using "while (SO != 0)" to wait for a low bus, which was used in the demo code for the CC1120.  I've never used a 'wait for low SO' procedure before in any SPI peripheral I've ever used before, so not sure if this is just recommended for this group of RF chips or not.  SD cards should be able to use mode 0 or 3.

I'm not sure why the SD card is holding the bus, but when I use Mode 0 for RF and Mode 3 for the SD card, or Mode 3 for both, everything works fine and no bus delay.  But, I'm not sure if Mode 3 is a good mode for the CC1120.  This only happens after doing an SD transaction and CS is raised back high again.

So, first things first, can the CC1120 be used in both SPI modes 0 and 3?

Also, I have 10K pullups on the SI and SO lines.

Sutton

  • I changed the 10K on MISO to 100K and now it works with no delay.  I've always had 10K on all other projects that had SPI bus with SD cards.  Not sure why the RF chip has trouble.

  • From the C1120 UserGuide (page 8):

    "When CSn is pulled low, the MCU must wait until CC112X SO pin goes low before starting to transfer the header byte. This indicates that the crystal is stable. Unless the chip was just reset or was in SLEEP or XOFF state, or the XOSC configuration has been altered, the SO pin will always go low immediately after pulling CSn low."

    Pull-ups and other devices on the same bus may impact this handshake. 

    I haven't looked into which SPI mode CC1120 uses but you should compare a plot of the bus with figure 3 in the UserGuide and verify that they are equal.