Hi
I modified the demo code so that it writes once per second some data to one of the pages.
It seems to work fine when left alone. If I try to read it using the demo GUI while this update cycle is going on, it will eventually hang. (It may take tens of reads but sometimes it hangs with just five) My guess is that there is a non-zero probability that the reading over the radio and writing by the µC will happen simultaneously and the radio chip does not like it. I first used this without the busy-waits but I added them later hoping that it would solve the issue. I have been able to see it hang at least with the red led on and with both leds on but I don't remember if green led has stayed on alone.
Any ideas on what is going on and how it can be stopped from happening?
The main loop in the modified demo code is now
Timer A clears the LPM_3 bits with one second intervals.
while (1)
{
LED_ON(LED_GREEN);
while ((P2IN&CU_BUSY) == CU_BUSY); // wait until busy goes low, PaLFI is ready then
Wake_PaLFI(); // Wake up PaLFI
LED_OFF(LED_GREEN);
LED_ON(LED_RED);
UCB0CTL1 &= ~UCSWRST; // activate SPI State machine
//SPI_Read_PCU_State(); // read PCU State
//SPI_Read_SerialNum(); // First PaLFI access defines selective address! (not implemented in PaLFI)
while ((P2IN&CU_BUSY) == CU_BUSY); // wait until busy goes low, PaLFI is ready then
SPI_Program_UserPage(Page54,page54Data);// programm Data in Page 11
LED_ON(LED_GREEN);
while ((P2IN&CU_BUSY) == CU_BUSY); // wait until busy goes low, PaLFI is ready then
SPI_Power_Down(); // Power down PaLFI
UCB0CTL1 |= UCSWRST; // deactivate SPI State machine
page54Data[1]++;
LED_OFF(LED_RED);
LED_OFF(LED_GREEN);
__bis_SR_register(LPM3_bits + GIE); // Enter LPM3, enable interrupts, only TIMERA Interrupt availabe
}