View previous topic :: View next topic |
Author |
Message |
ftrax
Joined: 24 Sep 2013 Posts: 22 Location: España
|
transceiver RFM69W don't receive |
Posted: Thu Jan 08, 2015 10:29 am |
|
|
Hi every One,
I have been working with RFM69W module transceiver for a few days.
I have achieved good result on Tx mode and transmit data but I don't know why the transceiver don't work on the Rx mode.
I hope somebody could help me.
As the code is very long, I give you a link with a .rar file.
https://1drv.ms/u/s!Ak-vLVSBQQHAgdUDReRBMKjhezVKyQ
When the driver and libraries will be finished I will post in the Code Library forum.
Last edited by ftrax on Tue Dec 18, 2018 11:20 am; edited 1 time in total |
|
|
ftrax
Joined: 24 Sep 2013 Posts: 22 Location: España
|
|
Posted: Mon Jan 12, 2015 1:28 am |
|
|
please, some advice?
I think I'm doing right and I need some help to figure out what I'm doing wrong. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Mon Jan 12, 2015 2:13 am |
|
|
Sorry, but if your code is so large, then I doubt if anybody is going to look at it. It is not the place/way to start for debugging. If it is the 'receive mode' that you are having problems with, then you need to do a basic program that just implements this. This is always the first thing to do when you have a problem. Isolate just the part with the problem. So PIC header. Serial. then the code to implement receive alone. This then becomes something that others may be prepared to look at. The funny thing is that often when you implement just the one part, the problem either disappears, or becomes apparent.... |
|
|
ftrax
Joined: 24 Sep 2013 Posts: 22 Location: España
|
|
Posted: Mon Jan 12, 2015 3:18 am |
|
|
Thank you for take some time to answer.
I think that the problem is in the “RXPacket” routine, line 264 in the RFM69.c or "SPIBurstRead" line 109 in the spi.c
this is the code
Code: | int RFM69W_RxPacket(void){
int i = 0;
//! if( input(IRQ) ){
if( IRQ ){
for(i=0;i<21;i++)
RxData[i] = 0x00;
SPIBurstRead(0x00, RxData, 21);
RFM69_ClearFIFO();
for(i=0;i<14;i++){
if(RxData[i]!=RFM69WData[i])
break;
}
if(i>=14) //Rx success?
return(1);
else
return(0);
}
else
return(0);
}
void SPIBurstRead( int adr, int *ptr, int length ){
int i = 0;
if(length<=1) //length must more than one
return;
else{
SCK = 0;
nSEL= 0;
SPICmd8bit(adr);
for(i=0;i<length;i++)
ptr[i] = SPIRead8bit();
nSEL= 1;
}
}
|
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Mon Jan 12, 2015 4:03 am |
|
|
I notice you don't read the RSSI value before the start of the burst read. What happens if you do?. |
|
|
ftrax
Joined: 24 Sep 2013 Posts: 22 Location: España
|
|
Posted: Tue Jan 13, 2015 1:15 am |
|
|
It is essential to read the RSSI before?
Which value should I expect?
Thank you very much. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Wed Jan 14, 2015 2:16 am |
|
|
I don't know, but the example does.
It just reads this before doing the burst read. |
|
|
ftrax
Joined: 24 Sep 2013 Posts: 22 Location: España
|
|
Posted: Wed Mar 11, 2015 9:05 am |
|
|
Hi guys, I finally could I solve the problem.
I created a new post in the section "Code Library" I have attached a .rar where there is a folder with all necessary files, also there is a .pdf with the scheme connection.
http://ul.to/7xukf4ts
Thanks for all. |
|
|
|