Hi,
I am experimenting with radio networking using six FRDM-K64F boards equipped with nrf23l01 transceivers.
I am splitting a second into ten time slots, the idea being that a transmission in slot 1 gets repeated in time slot 2, time slot 2 into time slot 3 etc for relaying.
So I am using PIT to generate interrupts at 100 ms periods, which I have checked on a scope.
On three boards, rev C,F, and F this is working fine and I am seeing the data on air being repeated. However with the three rev F1 boards my transmit routine gets hung waiting for time slot 1 to come around. I am not getting the interrupt!
Does anybody know what changed between, say rev F and Rev F1 that would cause this behaviour?
Here is my init routine:
SIM->SCGC6 |= SIM_SCGC6_PIT_MASK; // Turn on clock to to the PIT PIT->MCR = 0x1; // Enable PIT timers
PIT->CHANNEL[0].LDVAL = 5999999; // Set reload value to 100mS
PIT->CHANNEL[0].TCTRL = 0x03; // Turn PIT timer 0 on, interrupts on
and in main:
NVIC_EnableIRQ(PIT0_IRQn); // Enable PI timer, ch 0 interrupt
and the ISR:
void PIT0_IRQHandler(void)
{
/* Clear interrupt flag */
PIT->CHANNEL[0].TFLG = PIT_TFLG_TIF_MASK;
NVIC_ClearPendingIRQ(PIT0_IRQn); // Clear pending PI timer, ch 0 interrupt
//scope_trigger();
time_slot +=1;
if (time_slot >10) time_slot=0;
__DSB(); // Add for ARM errata 838869, affects Cortex-M4
}
any help appreciated!
cheers
nigel