I can not receive

Hi guys, I am trying to communicate the two boards, one of them is sending a frame constantly and the other one has to receive that frame. The problem is that I can not receive anything. I enable the interruptions but nothings happens. Also I turned on the receiver but nothing happen. Did Anybody have the same problem?

Thanks in advance,
Adrian.

Hello Adrian,

the chip is sometimes very confusing.

Did you make sure the interrupt is masked in the chip?

dwt_setinterrupt(SIGNAL, 1);

with SIGNAL
//DW1000 interrupt events
#define DWT_INT_TFRS 0x00000080 // frame sent
#define DWT_INT_LDED 0x00000400 // micro-code has finished execution
#define DWT_INT_RFCG 0x00004000 // frame received with good CRC
#define DWT_INT_RPHE 0x00001000 // receiver PHY header error
#define DWT_INT_RFCE 0x00008000 // receiver CRC error
#define DWT_INT_RFSL 0x00010000 // receiver sync loss error
#define DWT_INT_RFTO 0x00020000 // frame wait timeout
#define DWT_INT_RXOVRR 0x00100000 // receiver overrun
#define DWT_INT_RXPTO 0x00200000 // preamble detect timeout
#define DWT_INT_SFDT 0x04000000 // SFD timeout
#define DWT_INT_ARFE 0x20000000 // frame rejected (due to frame filtering configuration)

In your case, I would enable interrupts for RFCG, RPHE, RFCE, RFSL and ARFE.

You can also enable DWT_INT_TFRS and check in you sender if the interrupt is activated. I not, check your microcontroller, maybe your interrupts are not recognized on your controller. You can also check your interrupt by enabling DWT_INT_RFTO and set a certain delay using dwt_setrxtimeout(NUMBER); and than dwt_rxenable(1);

Hope that helps.

Hi Adrian,

I also recommend reading out the DIG_DIAG registers, see page 169 in
the DW1000 User Manual. They can give you a quick overview why packets
don’t arrive.

Greetings
Robin

Hi Adrian,

my suggestion is to enable receiver on the receiver side and read SYS_STATUS register, then transmit data from transmitter, and read out SYS_STATUS register on receivers side once again. If you see any changes (either errors, or partially received message) it means that your hardware most probably is good, but the problem lies in settings. Thats how I used to debug my application :slight_smile: Waiting for any news :slight_smile:

Regards,

Bartosz Kawłatow

es, I am doing that. I have one board transmiting mac messages, and another one is trying to recieve. I can receive the frame from the transmitter only if the second board send a package first.

This is my code to initialiase the receiver:

dwt_setrxtimeout(0);
dwt_setpreambledetecttimeout(0);
dwt_rxenable(0);

When that code is executed, I can not receive anything, but if after that code I send a package, I can receive frames. Why is that?

Thanks in advance.

It is so strange, because if I am sending I can receive frames, but I am not sending anything i can not receive. I will check the SYS_STATUS register because I activated all the interruptions and they works when I send information.

Thanks.

Hey man,

did you solve your problem? If yes, please write the reasons of your problem and a solution.

Regards,
Bartosz

Hi again,
not at all, when I solve a problem I get a new one. I could not receive because of the configuration, but now I can receive.
Mi problem is that I can not send properly after a reception. I would like to know if there is to clean or disable something. Theoretically, when you receive a frame, the radio returns to idle mode where you can send or receive, whatever you want, but I can not send.

Thanks in advance.

When you are preconfiguring device, be sure that you set SYS_CFG_RXAUTR in SYS_CFG_ID. In my application, after receiving a frame I simply turn off the transmitter by setting SYS_CTRL_TRXOFF in SYS_CTRL_ID register. After processing data I write data to the device and start a transmission. For me it works like a charm

did that, but I did not work. It is strange because theoretically when you receive a frame the radio returns to idle mode, but it is not happening in my case.

Do you use Decawaves source code?

No, I am doing my own software, but I am doing the same steps (more or less).

Hello Adrian,

the problem sounds familar. My chip was like super slow when I received and tried to send something back. I tracked the issue down and I have to set an timeout in the receive module. (Don’t ask my why this fixed my problem)

dwt_setrxtimeout(65000);

If this not going to work, I recommend to restart you chip, reinit your configuration. If this is working, remove parts of your initialization code unil you figure out what causes the failure.

Good luck!

That’s great actually that somebody is developing own piece of software. My algorithm is as follows:
Rx enable -> set timeout time(uC timer) -> after receiving a frame I stop a timer and process a data OR if a timeout occures I perform following sequence:

            DW_WriteFullRegister(SYS_MASK_ID,SYS_MASK_MRXDFR);                    //turn on an interrupt from receiving a frame, 

            DW_TRXoff();                                                                                            // TRX off 

            zmiennaxxx=DW_GetFullRegister(PMSC_ID);
            zmiennaxxx&=~(1<<28);                                                //RX Reset
            DW_WriteFullRegister(PMSC_ID,zmiennaxxx);

            zmiennaxxx=DW_GetFullRegister(PMSC_ID);
            zmiennaxxx|=(1<<28);                                                //RX SET
            DW_WriteFullRegister(PMSC_ID,zmiennaxxx);


            DW_RXenable();
            DW_NewState(poll_awaiting);
            DW_StartTimeoutTimer();

Afterward I just start waiting for a poll.

When I want to respond, I simply do:

TRXoff;
write necessary data to TX buffer,
Set an interrupt for transmitted frame,
start transmission,
wait for the end of sending process,
turn into receiver mode by:
enabling receive frame interrupt,
enabling RX (rxenab)
starting timeout counter.

hope I helped ? :slight_smile:

Bartosz Kawłatow

Did you also try dwt_setrxtimeout(0)? I think that a value of 0 should disable the timeout.

Thanks for everything. I solved the problem, I have configured the radio again. It look like if the radio is restarted or something like that.

Hi Adrian!

Can you share the steps you used when initializing receiving module?
I’ve stuck in just the same problem…
Besides, if I use polling, reading status reg constantly returns 0xdeaddead.
I tried to set rxtimeout to 0, but it didn’t help.

Stan