jogibaer
Joined: 03 Nov 2011 Posts: 8
|
MRF24J40 (pan)coordinator |
Posted: Tue Nov 29, 2011 10:03 am |
|
|
Hi.
I am working with the MRF24j40MB, the PIC 18F13K22 and the Zena Alayzer. My Compiler version is 4.114.
I want to create a wireless network between 2 modules. The transmitter is working fine. I can see that in the Zena Analyzer. My read function in my receiver seems to be right as well, but I am not able to receive any data. I followed the instruction in the data sheet.
http://ww1.microchip.com/downloads/en/DeviceDoc/39776C.pdf
(it is page 109)
and I realised it like this:
Code: |
void read_RX_FIFO()
{
int i=0;
SetShortRAMAddress(INTCON, 0b00001000);
SetShortRAMAddress(BBREG1, 0b00000100);
for(i=0; i<27;i++)
{
data_RX_FIFO[i]=GetLongRAMAddress(address_RX_FIFO);
}
SetShortRAMAddress(BBREG1, 0x00);
SetShortRAMAddress(INTCON, 0b00000000);
}
|
I debugged my code a lot of times and found out, that there is no data coming into the RXFIFO buffer. It is said that when the packet is accepted it is checked if it fits into the reception mode and the frame format. After that, the data is placed into RXFIFO and a Receive interrupt is issued. That is the RXIF bit of the INTSTAT register. I am reading the value of the INTSTAT register to check if the data is in the RX Buffer. I realised it like this in the main loop:
Code: |
SetShortRAMAddress(RXMCR, 0x01);
SetShortRAMAddress(RXFLUSH, 0x000);
temp=GetShortRAMAddress(INTSTAT);
if(temp== 0b00001000)
{
read_RX_FIFO();
}
|
I think that both modules are not able to find each other. So I checked the AN1066 MIWI note, because I want to create a MIWI protocol stack.
http://ww1.microchip.com/downloads/en/AppNotes/AN1066%20-%20MiWi%20App%20Note.pdf
I programmed my transmitter as a PanCoordinator and my Receiver as a coordinator. The short addresses have to be different, whereat the PanCoordinator always have to be 0x0000. On the other hand the Pan ID's have to be the same, that the modules can join a network.
At every time the value of the INTSTAT register is 0. That is why I think that no data is coming into the MRF module. I think I have to change anything of the addresses, filters or modes.
Would be glad if anyone could help.
jogi |
|