Other Parts Discussed in Thread: CC115L, CC113L, MSPM0G3507
Hi All,
I'm really looking for some straight forward sample code for CC113L and CC115L to test with MSPM0.
thank you in advance
Regards
Staneslouse
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.
Hi All,
I'm really looking for some straight forward sample code for CC113L and CC115L to test with MSPM0.
thank you in advance
Regards
Staneslouse
Hi Staneslouse,
We don't have any examples with either of these transceivers. These look like they are intended to work with a standard SPI interface, which we do have some examples for (see here in TI Resource Explorer).
I will see if I can get someone from the wireless connectivity forum that can comment on if we have anything generic or for another MCU that you might be able to leverage.
Best Regards,
Brandon Fisher
Hi Staneslouse,
As of today, the easiest way would be to use the existing CC113L/CC115L drivers present in this package: https://www.ti.com/tool/download/SWRC219
If you look at the per_test folder from that archive, you will find SPI macros that you could redefine to use MSPM0 SPI calls instead.
Regards,
Arthur
hi Arthur,
I have setup CC115L with MSPM0 using SPI macros that given in the per_test. please see blow forum https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1302202/cc115l-cc115l-interface-with-mspm0/4945562#4945562 I have posted in the wrong dept.
main problem was one of our legacy receiver not received paring message and relay on message.
I want to know the SPI clock frequency that used in the SPI_periperal_eco_interrupts example? and how I can modify the SPI clock frequency. It may be an issue hopefully.
Regards
Staneslouse
hi Arthur,
I really need a SPI example to initiate command like thins cc1101SpiWriteReg(preferredSettings[i].addr, &writeByte, 1);
Is there any matching example is MSPM0 SDK?
Kind regards
Staneslouse
Hi Staneslouse,
Have you had a look at the spi_controller_register_format_LP_MSPM0G3507_nortos_ticlang example? From the MSPM0 SDK?
You should just plug those calls into the cc1101SpiWriteReg, instead of the old MSP430 register calls.
Regards,
Arthur
hi Arthur,
I have rewrite code to configure CC115L & transmit some data, unfortunately It doesn't transmit accordingly. could you please advice me on this, here with attached the code.
PHY - OOK/433/2byte sync
SPI settings also attached.
Kind regards
Staneslouse
#include "ti/driverlib/m0p/dl_core.h" #include "ti_msp_dl_config.h" #include <sys/_intsup.h> #include <sys/_stdint.h> #define IOCFG2 0x00 #define IOCFG0 0x02 #define FIFOTHR 0x03 #define SYNC1 0x04 #define SYNC0 0x05 #define PKTLEN 0x06 #define PKTCTRL0 0x08 #define FREQ2 0x0D #define FREQ1 0x0E #define FREQ0 0x0F #define MDMCFG4 0x10 #define MDMCFG3 0x11 #define MDMCFG2 0x12 #define MDMCFG1 0x13 #define MDMCFG0 0x14 #define DEVIATN 0x15 #define MCSM0 0x18 #define FREND0 0x22 #define FSCAL3 0x23 #define FSCAL2 0x24 #define FSCAL1 0x25 #define FSCAL0 0x26 #define TEST2 0x2C #define TEST1 0x2D #define TEST0 0x2E #define VERSION 0x31 #define MARCSTATE 0x35 #define SIDLE 0x36 // CC115L Strobe for Idle #define SFSTXON 0x31 // CC115L frequency calibration #define STX 0x35 // CC115L enable transmite #define SRES 0x30 // CC115L Reset #define FIFO_Data 0x7F // Burst write data #define FIFO_PAtable 0x7E // burst PA write uint8_t PA_TABLE[] = {0x00,0xc0,}; uint8_t pairmessage[] = {0x06,0x95,0x65,0x56,0x55,0x55,0x5a,}; // first byte for length uint8_t relay_on_message[] = {0x06,0x95,0x65,0x55,0x95,0x65,0x66,}; void halRfWriteBurst(uint8_t addr, uint8_t *buf, uint8_t cnt) { DL_GPIO_clearPins(Chip_Select_PORT, Chip_Select_CS_PIN); //while(Status_GDO2_PIN) {}; DL_SPI_transmitData8(SPI_0_INST, addr); while(cnt--) { DL_SPI_transmitData8(SPI_0_INST, *buf++); } DL_GPIO_setPins(Chip_Select_PORT, Chip_Select_CS_PIN); } void halRfWriteReg(uint8_t reg_addr, uint8_t value) { DL_GPIO_clearPins(Chip_Select_PORT, Chip_Select_CS_PIN); //while (Status_GDO2_PIN) {}; DL_SPI_transmitData8(SPI_0_INST,reg_addr); DL_SPI_transmitData8(SPI_0_INST,value); DL_GPIO_clearPins(Chip_Select_PORT, Chip_Select_CS_PIN); } void halRfStrobe(uint8_t strobe) { DL_GPIO_clearPins(Chip_Select_PORT, Chip_Select_CS_PIN); //while (Status_GDO2_PIN) {}; DL_SPI_transmitData8(SPI_0_INST,strobe); DL_GPIO_clearPins(Chip_Select_PORT, Chip_Select_CS_PIN); } void cc115L_configureRF(){ halRfWriteReg(IOCFG2,0x06); //GDO2 Output Pin Configuration halRfWriteReg(IOCFG0,0x06); //GDO0 Output Pin Configuration halRfWriteReg(FIFOTHR,0x47); //TX FIFO Thresholds halRfWriteReg(SYNC1,0xAC); //Sync Word, High Byte halRfWriteReg(SYNC0,0x59); //Sync Word, Low Byte halRfWriteReg(PKTLEN,0x06); //Packet Length halRfWriteReg(PKTCTRL0,0x04); //Packet Automation Control halRfWriteReg(FREQ2,0x10); //Frequency Control Word, High Byte halRfWriteReg(FREQ1,0x12); //Frequency Control Word, Middle Byte halRfWriteReg(FREQ0,0x34); //Frequency Control Word, Low Byte halRfWriteReg(MDMCFG4,0xF6); //Modem Configuration halRfWriteReg(MDMCFG3,0x37); //Modem Configuration halRfWriteReg(MDMCFG2,0x31); //Modem Configuration halRfWriteReg(MDMCFG1,0x42); //Modem Configuration halRfWriteReg(MDMCFG0,0xE5); //Modem Configuration halRfWriteReg(DEVIATN,0x14); //Modem Deviation Setting halRfWriteReg(MCSM0,0x18); //Main Radio Control State Machine Configuration halRfWriteReg(FREND0,0x11); //Front End TX Configuration halRfWriteReg(FSCAL3,0xE9); //Frequency Synthesizer Calibration halRfWriteReg(FSCAL2,0x2A); //Frequency Synthesizer Calibration halRfWriteReg(FSCAL1,0x00); //Frequency Synthesizer Calibration halRfWriteReg(FSCAL0,0x1F); //Frequency Synthesizer Calibration halRfWriteReg(TEST2,0x81); //Various Test Settings halRfWriteReg(TEST1,0x35); //Various Test Settings halRfWriteReg(TEST0,0x09); //Various Test Settings halRfWriteReg(VERSION,0x19); //Chip ID halRfWriteReg(MARCSTATE,0x01);//Main Radio Control State Machine State halRfWriteBurst( FIFO_PAtable, PA_TABLE, 2); } int main(void) { SYSCFG_DL_init(); //NVIC_ClearPendingIRQ(SPI_0_INST_INT_IRQN); //NVIC_EnableIRQ(SPI_0_INST_INT_IRQN); NVIC_EnableIRQ(GPIO_SWITCHES_INT_IRQN); halRfStrobe(SRES); cc115L_configureRF(); while (1) { /* Wait for interrupt until a push button is pressed */ __WFI(); } } void GROUP1_IRQHandler(void) { switch (DL_Interrupt_getPendingGroup(DL_INTERRUPT_GROUP_1)) { case GPIO_SWITCHES_INT_IIDX: switch (DL_GPIO_getPendingInterrupt(GPIO_SWITCHES_PORT)) { case GPIO_SWITCHES_USER_SWITCH_1_IIDX: /* When SWITCHES_USER_SWITCH_1 is pressed, initiate data transmission */ halRfWriteBurst( FIFO_Data, pairmessage, 7); //send pair message halRfStrobe(STX); //delay_cycles(25000000); halRfWriteBurst( FIFO_Data, pairmessage, 7); //send pair message halRfStrobe(STX); delay_cycles(25000000); halRfWriteBurst( FIFO_Data, pairmessage, 7); //send pair message halRfStrobe(STX); delay_cycles(25000000); halRfWriteBurst( FIFO_Data, relay_on_message, 7); halRfStrobe(STX); halRfStrobe(SIDLE); delay_cycles(25000000); break; default: break; } break; default: break; } }
Hi Staneslouse,
Do you meant the CC115L does not transmit correctly or you are not seeing proper SPI communication with the device?
Best Regards,
Brandon Fisher
Hi Brandon,
I have correct some of chip select sequence and now I can see proper SPI communication, but radio not transmit correctly. when look at the above interrupt loop, CC115L should transmit pair message 3 times but I can see when I press the switch couple of time the pair message detected by our legacy RF product.
I used DL_SPI_isBusy(SPI_0_INST) to check before transmit next byte but unfortunately it not working.
Kind regards
Staneslouse
Hi Staneslouse,
If you are migrating a legacy setup, do you still have access to old hardware from the end of the communication channel you are replacing, and did it also use the C115L?
If so it might be worth it to probe both the old and new SPI traffic on both sets of hardware to see if there are any notable differences in command structure/sequence.
Best Regards,
Brandon Fisher
hi Brandon,
unfortunately we are migrating from Atmel for both micro and radio.
Kind regards
Staneslouse
Hi Staneslouse,
Is the sequence of commands you are sending still the same as in the above code?
When you say you've observed correct SPI comms, was this validated on a logic analyzer or Oscope?
Apologies if these questions seem redundant, I'm just trying to narrow down whether the issue is on the C115L side or the MSPM0 side.
If you have a capture of the whole sequence that would be helpful as well.
Best Regards,
Brandon Fisher