This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM42 and MibSPI port

Hi, 

We are currently using RM42 for one of our applications. I just one question regarding MibSPI port. 

There are 4 chip select signals CS[0..3] for MibSPI port, but what if I would like to interface to more than 4 sensors, am I able to use another GPIOs as chip selects?

We plan to poll 6 sensor every 1ms and then save the result into MibSPI RAM. In that case, CPU can copy the sensor values whenever it needs them.

  • Jay,

    You could use other GPIO as a chip select - but you'll need to manipulate these GPIO through software around the SPI transaction.

    Another option to consider would be to use a device like www.ti.com/.../sn74ahct138.pdf to decode 3 of the chip select from the MibSPI to 8 output chip selects. You would use one chip select to enable the others. So with the 4 chip selects out of the MibSPI - you could control 9 different combinations (nobody selected, plus 8 individual selected devices).

    The reason that you can do this is that value that you write to the CSNR field of the SPIDAT1 register appears on the chip select pins, and it isn't restricted to 1110, 1101, 1011, 0111, it can be any combination. There is a SPIDEF register that sets the default chip select pattern (when there is no activity) and you would set this to 1111.

    So you could do something were 1111 = no activity, and 0xyz activates a chip select, and decodes xyz to 1 of 8 chip selects through the hct138 device.

    This costs maybe < $0.10 but it would work well with DMA driven transfers and it wouldn't require the CPU to change a GIO pin to activate a different chip select, since you would DMA both the chip select # and the data to SPIDAT1 at the same time