Dear all,
I'm Huy and I currently work with TRF7960 using LM3S6950.
I got a difficult problem that the MCU can not read back any value from TRF7960 (the MISO of TRF7960 is always 0)
I use SPI mode with SS pin for TRF7960
Here is the schematic of my TRF7960 module (I just make it to test the communication with MCU only, so all three pins (pin 5,8,9) of RF are floating)
Here is the code of the MCU to write and read TRF7960's registers:
SYSCTL_LDOPCTL_R = SYSCTL_LDOPCTL_2_75V ;
SysCtlClockSet(); // setup PLL
NVIC_ST_RELOAD_R = (SYS_CLK / SYSTICKHZ) - 1; // 1000 SysTick interrupt per second
NVIC_ST_CTRL_R |= (NVIC_ST_CTRL_CLK_SRC | NVIC_ST_CTRL_ENABLE); // enable SysTick
NVIC_ST_CTRL_R |= NVIC_ST_CTRL_INTEN;
InitializeBoard(); // configure GPIO, SSI, UART, etc
CLEAR_TRF_EN; // disable TRF7696 at beginning
delay_ms(1);
SET_TRF_EN;
delay_ms(1);
command[0] = ModulatorControl; // select 13.56MHz clock
command[1] = 0x31; //13.56 MHz
WriteSingle(command, 2);
command[0] = ChipStateControl; // 3.3V mode
command[1] = 0x20;
command[2] = ISOControl; // ISO15693
command[3] = 0x02;
WriteSingle(command,4)
while(1) // try to read back some registers of TRF7960
{
reg[0]=0x00;
ReadSingle(reg,1);
reg[0] = 0x01;
ReadSingle(reg,1);
reg[0] = 0x02;
ReadSingle(reg,1);
reg[0] = 0x03;
ReadSingle(reg,1);
reg[0] = 0x04;
ReadSingle(reg,1);
reg[0] = 0x05;
ReadSingle(reg,1);
reg[0] = 0x06;
ReadSingle(reg,1);
reg[0] = 0x07;
ReadSingle(reg,1);
reg[0] = 0x08;
}
The MCU outputs SCK, SS, MOSI correctly but MISO is always 0 as shown in the waveform below:
Note: Line15=MOSI, Line14=MISO, Line13=SS, Line12=SCK, Line10=EN
Could anyone help me what is the reason of my problem ?
Thanks,
Huy