Hello ,
I'm trying to control the CC1120EM transceiver through an Arduino Nano board, using SPI communication. The connection diagram is as follows:
Arduino Nano Board CC1120EM
P1/P2 SMD_SOCKET
3V3 ------------------------------------------------------------------------ P2.9 (3V3)
D10 (SS) ---------------------------------------------------------------- P1.14 (CSN)
D11(MOSI) --------------------------------------------------------------- P1.18 (MOSI)
D12 (MISO) -------------------------------------------------------------- P1.20 (MISO)
D13 (SCLK) -------------------------------------------------------------- P1.P1.16 (SCLK)
D4 (RST line) ------------------------------------------------------------ P2.15 (RST)
GND ------------------------------------------------------------------------ P2.2 (GND)
Through D4 line I control the RST pin.
The code I use runs in the Arduino programming environment (http://arduino.cc/), and basically performs the following operations:
1. Define pins 11(MOSI), 13(SCLK), 10(SS) and 4(RST) as output pins.
2. Activate SPI communication (http://arduino.cc/en/Reference/SPI)
3. Define SPI communication parameters:
3.1 MSB First
3.2 SCLK frequency: 4 MHz
3.3 Clock polarity (idle) : Low, Rising edge capture.
4. Start SPI session
5. RST = '1'
6. while (true)
6.1 SS = '0'
6.2 Transfer byte
6.3 Transfer byte
6.4 Transfer byte
...
6.5 SS = '1'
I expected to receive some sort of response from the transceiver when sending determined bytes, but the answers are very strange, and I'm not able to associate them to what is specified in the User guide. I've tried sending Command Strobes, such as '0x35', which should change the transceiver state from IDLE to TX, but i can't see if the transceiver is receiving correctly the command. The next image shows an attempt to establish communication:
The green signal corresponds to SCLK, the purple one to MOSI (Commands sent to the CC1120), and the yellow one should be the answer from the CC1120. In this particular example, I try to:
1. Read form a register
2. Write in that register
3. Read again to see if it has changed.
Additionally, whenever I send the byte '0x00' the transceiver answers with '00001111', doesn´t matter if I send it first, in the middle of a transmission, or at last. Whenever I try to send that word, in each clock cycle I receive '00001111',
For instance, if I send '0x8c', I receive a strange response, lets say, for example ('10001110'), whereas when sending '0x8c' '0x00', the answer is '00001111 00001111'.
So, the main problem i have is that I am not able to manipulate the CC1120 registers, although it seems that both Arduino and CC1120 are communicating.
I would like to know if my communication method is correct, or what could I do to effectivly achieve communication between the two boards.
Thanks in advance.
Emilio.