nordic nrF24L01 disable TX_DS

I have some difficulty with disabling TX_DS as an interrupt.

if you set mask_TX_DS to “0” in the CONFIG register this must not happen but is does.

even when the flag is cleared in the STATUS register after transmitting

SPIradio_WriteReg(RADIO_REG_STATUS, _BV(REG_STAT_TX_DS));

has this to do with disabling auto_ack or so? because I have read that in certain occasions the radio ASSERTS the TX_DS interrupt even if there is no transmission done.

It is also is possible that it has to do with timing because i set the radio to recieve right after transmitting

   			SPIradio_WriteTxPayload((unsigned char*) pTXbuffer);
    			while(TCNT2!=6); //wait till 192 us are done after begin of timeslot
    			SPIradio_SetPower(SPIRADIO_TRANSMIT);// set radio in transmitting mode
        		SPIradio_SetPower(SPIRADIO_RECEIVE); // after transmitting change radio in recieve mode

so maybe I don’t wait long enough but I don’t know how long I have to waith and if it is possible that it changes back to receive before it is done sending its pakkets.

Gert-Jan:
if you set mask_TX_DS to “0” in the CONFIG register this must not happen but is does.

even when the flag is cleared in the STATUS register after transmitting

This makes sense, since setting MAX_TX_DS to ‘0’ enables the interrupt on the IRQ pin. You must set the bit to ‘1’ to disable it.

so maybe I don’t wait long enough but I don’t know how long I have to waith and if it is possible that it changes back to receive before it is done sending its pakkets.

According to p. 22 of the 24L01 datasheet, you must wait for 130 uS from the time you go from TX standby until you can receive packets properly in RX mode (Tstby2a).

brennen:

Gert-Jan:
if you set mask_TX_DS to “0” in the CONFIG register this must not happen but is does.

even when the flag is cleared in the STATUS register after transmitting

This makes sense, since setting MAX_TX_DS to ‘0’ enables the interrupt on the IRQ pin. You must set the bit to ‘1’ to disable it.

so maybe I don’t wait long enough but I don’t know how long I have to waith and if it is possible that it changes back to receive before it is done sending its pakkets.

According to p. 22 of the 24L01 datasheet, you must wait for 130 uS from the time you go from TX standby until you can receive packets properly in RX mode (Tstby2a).

ok maybe I must tell you more:

I am using 5 devices which are all connected with a atmega645 who communicate which each other trough a nRF24L01. It functions almost like it should be, the only problem is that microcontroller receives an IRQ TX_DS. I have tried to mask this interrupt by setting it with a “0” and a “1” in the CONFIG register:

Mnemonic CONFIG

bit 5 MASK_TX_DS

Mask interrupt caused by TX_DS

1: Interrupt not reflected on the IRQ pin

0: Reflect TX_DS as active low interrupt on the IRQ pin

because of the comment “low interrupt” have I tried to react on:

-low level

-logical change

-falling edge

-rising edge

without any luck.

I also have read that dispite off the different memorybuffers RX and TX share the same addresses. So maybe it is possible that an IRQ comes because of an RX action because of setting it to soon in receiving mode???. For this reason I wait 150 us when I disable CE after transmitting and after recieving. And I wait 150 us after setting CE in transmitting en recieving.

an other reason that might be possible is that I have disabled autoretry en acknoledgement:

//minimum delay (250us) for retransmit and no auto-retry after failed transmission

SPIradio_WriteReg(RADIO_REG_SETUP_RETR, _BV(0x0000));

//disable auto acknoledgement for all pipelines

SPIradio_WriteReg(RADIO_REG_EN_AA , _BV(0x0000));

at this way EN_AA and SETUP_RETRY both has the value 0x000.

the only moments that TX_DS set are:

nRF24L01 asserts the TX_DS IRQ when the ACK packet is received

and if auto retransmit is disabled when in TX mode.

Will the TX_DS mask also work if auto retransmit is disabled or will it always come dispite this mask?

I also have send this to Nordic Norway but the work on other days becose I don’t have received an answer jet :wink:

I have received a response…

What I was afraid for has happened

It will always give a TX_DS when you don’t check for acknoledgement

so if you don’t want an interrupt you have to disable INT0 of try to clear the flag before interrupts are enabled

thanks anayway for the response

Under what circumstances do you mean “It will always give a TX_DS when you don’t check for acknoledgement”? And what is INT0? Could you possibly paste the Nordic rep’s response so we know about this issue in more detail?

brennen:
Under what circumstances do you mean “It will always give a TX_DS when you don’t check for acknoledgement”? And what is INT0? Could you possibly paste the Nordic rep’s response so we know about this issue in more detail?

"I recommend to download the nAN24-12SW package.

The nAN24-12SW package contains source code that helps you set up the nRF24L01

and nRF24LU1 in the ShockBurst" modes. It contains all the files necessary for

setting up the devices using only the Hardware Abstraction Layer.

http://www.nordicsemi.no/files/Product/ … 4-12SW.zip

The IRQ should be pretty straight forward, you can disable the IRQ source and/or

clear the interrupt flag. Remember that you can also experience MAX_RT if there

is no receiver. If you don’t use ACK, then you will allways get TX_DS since it

will not check if any receiver actually received the data"

so he says that there will be an interrupt despite the fact that you mask it because you don’t want it (for as far as I understand because you can see it as you can mask it or you can mask it but it will come)

the radio has a function to respond that the packet is received and if the transmitting radio doesn’t check acknowledgment it will always give TX_DS flag which gives an interrupt to the micro controller that controls it and an external interrupt (INT0) will come.

I am still trying to clear the flags before enabling the interrupt with no luck for so far:

even if I wait 150 us the flag isn’t cleared. maybe it will work if I use polling while waiting at the flag and then clear it.