Tool/software:
Hello everyone.
I am working against time to solve a problem with my CC1310 device and hope to have your help.
My CC1310 custom board includes a MPU6050 accelerometer which is connected to the DIO6 pin and its configuration is as follows.
PIN_Config pinTable[]={
/*Accelerometer interrupt*/
CC1310_LAUNCHXL_ACEL_INT | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE | PIN_HYSTERESIS,
PIN_TERMINATE
};
In first instance my CC1310 device detects movement by means of the interrupt on the DIO6 pin and sends data by UART (here everything is fine).
After getting a response from the UART receiving device, my CC1310 device (transmitter) must read data from a sensor via SPI, this data is loaded into the payload TX packet and sent to a CC1310 receiving device, the latter must respond to the transmitter with an acknowledgement (from this point onwards the problem occurs sometimes) I have observed that if the transmission and reception of RF message mentioned above is not completed correctly the system in the transmitter crashes. (to solve this I thought that with a push of the reset button on my cc1310 device (transmitter) everything would work fine and my life would be happier) but the problem is that after the reset the CC1310 does not detect the motion interruption coming from the MPU6050 and it can only operate correctly again if I disconnect and connect the power (battery) completely.
What can cause this behavior and how can I fix it?
Does the pin reset turn the CC1310 completely off and on all DIOs including the RF core?
Is it just a problem with the MPU6050?
I have done a second code omitting the RF message transmission section and when reset by the pin it works as I expect, so my intuition tells me that the problem could be caused by that section.
This is my RF section, is there anything wrong or that I am not taking into account?
txPacket.payload[0] = 0xAE;
txPacket.payload[1] = 0x00;
txPacket.payload[2] = 0xB1;
txPacket.payload[3] = 0xDD;
uint8_t j,i;
for(j = 4, i = 0;j!=sizeof(ID_Main)+5;j++,++i){
txPacket.payload[j] = ID_Main[i];
}
uint8_t k,l;
for(k = 12, l = 0;k!=sizeof(TID)+13;k++,++l){
txPacket.payload[k] = TID[l];
}//*/
txPacket.len = 24;
memcpy(&txPacket.dstAddr,&dir_broadcast, sizeof(dir_broadcast));
EasyLink_transmitAsync(&txPacket, TxDoneCb);
Semaphore_pend(RXSem, BIOS_WAIT_FOREVER);
EasyLink_receiveAsync(rxDoneCb, 0);
if(Semaphore_pend(RXSem, (3000000 / Clock_tickPeriod)) == FALSE){
if(EasyLink_abort() == EasyLink_Status_Success){
Semaphore_pend(RXSem, BIOS_WAIT_FOREVER);
}
}
Thanks in advance!