This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf24le1 input status changed very slowly

void io_init(void) //P0 input with inner pull up. { P0DIR = 0xFF;
P0CON = 0x50;
P0CON = 0x51;
P0CON = 0x52;
P0CON = 0x53;
P0CON = 0x54;
P0CON = 0x55;
P0CON = 0x56;
P0CON = 0x57;
}

void TX_Mode(void) { SPI_RW_Reg(WRITE_REG + CONFIG, 0x0e); id_buf[0]=P0; SPI_Write_Buf(WR_TX_PLOAD, id_buf, TX_PLOAD_WIDTH); RFCE=1; delay(10); RFCE=0; }

The P0 with inner pull up, and with keys to GND.TX_Mode will be called each second, when key pressed and released ,the value of P0 changed very slowly , it will need about 2-3 second to update the status(key down, and key release), monitored by received packet buf[0]. that is very strange , what is wrong?

Parents
  • Are you keeping track of the button pushes and updating the TX_FIFO with the correct payload as soon as possible? It sounds like the status of the pins isn't reflected to the TX payload soon enough. Are you sure you actually receive a packet every second? Could it be that you are missing some packets on the receiver side? Add a counter to the packet to ensure that you are in fact receiving them all.

Reply
  • Are you keeping track of the button pushes and updating the TX_FIFO with the correct payload as soon as possible? It sounds like the status of the pins isn't reflected to the TX payload soon enough. Are you sure you actually receive a packet every second? Could it be that you are missing some packets on the receiver side? Add a counter to the packet to ensure that you are in fact receiving them all.

Children
Related