Hei!
I have got a school project where I am supposed to create first a RF source at 868 Mhz. For this purpose, I am using the RF-module DRF4463F based on a Si4463 chip commanded by a TM4C123GXL micro-controller. I can actually start the project itself after I got the source working.
I got the SSI connected the following way:
CLK -> SCLK
FSS -> nSEL
TX -> SDI
RX -> SDO
The transmission part works fine with a 8-bit serial-parallel shift register SN74HC595N where are connected 8 LEDs to its outputs. So, when i send a word like 0x01 I see the same with the LEDs. I can say the transmission works. The problem appears in the response of the RF module which is always 0xFF whatever the sent command. The code I wrote so far is the following:
void main(void) { spi_init(); // initialize SSI ports and 2 general GPIOs uint8_t response[] = {0x00,0x00,0x00,0x00}; uint8_t data[] = {0x01,0x00}; // data to be sent to the RF-module send_data(data,2); // send the 2 value of the data SSIDataGet(SSI3_BASE, &response); // receive the response } void spi_init(void) { // Initialize the ports SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); GPIOPinConfigure(GPIO_PD0_SSI3CLK); GPIOPinConfigure(GPIO_PD1_SSI3FSS); GPIOPinConfigure(GPIO_PD2_SSI3RX); GPIOPinConfigure(GPIO_PD3_SSI3TX); GPIOPinTypeSSI(GPIO_PORTD_BASE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_4|GPIO_PIN_5); // for later use // Set the frequency of the SSI communication. Here 1MHz with 8 bits-words set on mode 0. SSIConfigSetExpClk(SSI3_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 1000000, 8); SSIEnable(SSI3_BASE); } void send_data(uint8_t *data, unsigned char data_length) // use to send multiple words { unsigned char i; for (i = 0; i < data_length; i++) { SSIDataPut(SSI3_BASE, *(data+i)); while(SSIBusy(SSI3_BASE)){} //SysCtlDelay(10000000); } } unsigned char * read_response(unsigned char size_response) // I am not sure if that one works. It is meant to read the response. { unsigned char i; uint8_t response[size_response]; for (i = 0;i<size_response;++i) { SSIDataGet(SSI3_BASE, &response[i]); while(SSIBusy(SSI3_BASE)){} } return response; }
The code is written with CCS using Tivaware. I use the port D (SS3), set at 1MHz with mode 0 (rising edge of clock and FSS set to low to send values). I tried the other mode and it doesn't work. I don't use yet the read_response() function since the SSIDataGet() alone doesn't get the right answer. It is said in the data sheet of the chip of the module (here, page 16) that the maximum communication frequency is 10 MHz.
I have been trying for almost a month and I'm starting to be short of ideas. I forgot to mention that I'm not an expert in µC nor in C programming. I just have the basics. If someone got any idea why it doesn't work, I would be thankful. Thank you in advance.
-John-