Jump to content
43oh

LM4F120XL + NRF24L01 - Frequency Hopping


Recommended Posts

Hi,


I would like to build Frequency Hopping system based on MCU LM4F120Xl and chip NRF24L01. I send packets every 1 ms. Receiver saves packet if there is interruption from IRQ pin. But when I send 100 packets from the transmitter, I get 90 interrupts int the receiver. But the transmitter receives all ACK packets. I use Code Composer Studio v5.


Do you have any solutions?


Thank you very much for your help.


Link to post
Share on other sites

AFAIK the NRF24 does not support bidirectional transfer, in this case the ACK is from the transmitter "I sent this packet successfully", which is not the same as an ACK from the receiver "I received the packet successfully".

In other words; 10 of your packets got lost in the ether.

 

Any more help requires you to share your design with us, or we'll just be guessing.

Link to post
Share on other sites

Ok, I understand.

AFAIK the NRF24 does not support bidirectional transfer

 

That's why transmitter  counts undelivered packets when the receiver is turned off?

 

Timer interrupt sends packets every 1 msec:

void Timer1_Int_Handler(void)
{

	int lost_packets = 0;
	TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
	RF_Power_Down();
	channel = 3;
	RF_Set_Channel(channel); //temporarily constant
	Delay_us(150);
	RF_Power_Up();
	RF_Start_TX();
	RF_Print(data);
	RF_TX();
	Delay_us(200);
	lost_packets = RF_Read_Reg(NRF24_OBSERVE_TX) >> 4;

	if(lost_packets == 0)
	counter_test++;
	else
	UARTprintf("not received ACK! \n");

	if(counter_test > 100)
	{
		Chanel_Change_Stop(); //Timmer stop
		UARTprintf("Send: %d \n", counter_test);
	}

}

GPIO interrupt from PE_3 pin.

void irq_test(void)
{
	GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_3);

	RF_payload_length = 0;
	if ( !(RF_Read_Reg(NRF24_FIFO_STATUS) & NRF24_RX_EMPTY) )
	{

		payload_length = RF_Get_Payload_Length();
		RF_Read_Payload(inbuff, payload_length, 32);
		inbuff[payload_length] = '\0';
		RF_Clear_IRQ(NRF24_IRQ_RX);
		RF_Write_Reg(NRF24_STATUS, BIT6);Delay_us(50);
		RF_Power_Down();
		channel = 3;
		RF_Set_Channel(channel); //temporarily constant
		Delay_us(150);
		RF_Power_Up();
		RF_Start_RX();
	}
	counter_test++; //interrupt counts
}
GPIOPinTypeGPIOInput(GPIO_PORTE_BASE, GPIO_PIN_3);
GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
GPIOIntTypeSet(GPIO_PORTE_BASE, GPIO_PIN_3, GPIO_FALLING_EDGE);
IntPrioritySet(INT_GPIOE, 0x20);
GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_3);
GPIOPinIntEnable(GPIO_PORTE_BASE, GPIO_PIN_3);
IntEnable(INT_GPIOE);
IntMasterEnable();

But if I send the packets every 10 msec, the number of interrupts at the receiver is the same as the number of packets sent. When I send 100 packets every 1 msec from the transmitter, I get 90 interrupts int the receiver.

Link to post
Share on other sites

When you are using the Enhanced ShockBurst autoack feature (only available at 1Mbps and 2Mbps), the ACK is actually from the receiver.

 

Your biggest problem is that you're sending every 1ms.  That's way, way, way too fast for the nRF24L01+ logic flow from what I recall in the datasheet.  10ms might be pushing it too but it sounds like it's working well for you.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...