Reading data from an external IC with the provided clock signal

Hello everybody,

I'm trying to interface my arduino uno with an spirit1 rf transceiver. I use SPI pins to set register values and read data. However, the spirit1 has GPIO pins on which it is possible to write data to be transmitted and read received data. The spirit1 provides a clock signal on one of the gpio pins to sync with the MCU. Here what the datasheet says "the packet bits are continuously written to one of the GPIO
pins without any processing. To allow the synchronization of an external data sink, a
data clock signal is also provided on one of the GPIO pins. Data are updated by the
device on the falling edge of such clock signal so the MCU must read it during falling
edge of CLK."

I'm a novice in electronics. Can somebody help me to read the data from the gpio of this ic?

Here is the datasheet: http://www.st.com/content/ccc/resource/technical/document/datasheet/68/6c/7b/ec/b2/6b/49/16/DM00047607.pdf/files/DM00047607.pdf/jcr:content/translations/en.DM00047607.pdf

Thanks in advance.
Onil.

From a quick overview of the datasheet I would say that you can read the data using the SPI interface. Why do you want to use the low level interface using the GPIOs when you have the SPI interface which is supported directly by your Arduino?

Hello pylon,

Thanks for you replay. As you can see from the data sheet, the spi module have 8 pins for IO. 4 of them are SS, MOSI, MISO and SCK which i have already connected to my Arduino. With those pins i'm able to set registers of the IC. As you can see, there are 4 more pins, which are GPIOs and i need to read data from 2 of those pins. On one pin it will provide the clock signal and on the other the data. So, i can connect GPIOs to the SPI line, or is it possible?

Thank you.
Onil.

SPI only uses 4 pins CSn, SCLK, SDI & SDO and it's possible to read rx data/status and write tx data/settings through these pins. The GPIO pins can be configured for several purposes (see Table 37 in the datasheet) and the possible option would be to use nIRQ configuration so the chip tells the Arduino when data is available to receive so it can download it over SPI. No real need to read rx data over the GPIO pins using interrupts.

Hi Riva,

I need read the characteristics of the signal such as the length of highs and lows in real time as the signal is received. Therefore, it's no use for me to read received bytes from the fifo. I need the access to the realtime data stream as it gets out from the demodulator.

Thanks,
Onil

centigradz:
I need read the characteristics of the signal such as the length of highs and lows in real time as the signal is received.

Okay, that makes sense now.
You will need to configure 2 of the GPIO pins to give you receiver clock & data. If you then connect the clock to a hardware interrupt pin on the Arduino and data to another digital pin. Write an interrupt routine to fire on a falling edge and in this routine you read the data pin and mark the time since the last bit arrived. What you do with this data is up to you but try to spend as little time as possible in the interrupt code.

As you can see, there are 4 more pins, which are GPIOs and i need to read data from 2 of those pins.

Why? You can read the data from the SPI. Why don't you use the SPI interface to read the data from the chip? The GPIOs are to be used by a processor that doesn't have an SPI interface (I guess) but if you have that interface you can communicate everything over it, including the transfered data, at least that's my understanding of the datasheet.