CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

[SOLVED] Receive problems with MRF24J40MA module

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

[SOLVED] Receive problems with MRF24J40MA module
PostPosted: Tue Sep 27, 2011 2:59 am     Reply with quote

Hi,

I am working on the MRf24J40MA module, I have managed to send and receive a few packets using two identical MRf24J40MA modules connected to 2 18F2620 mcus.

To receive packets I use the INT pin of the module connected to B0 of the mcu, though I can detect packets (INT line goes low), I get wrong data while reading the RXFIFO buffer. But sometimes packets are read correctly.

Can anyone advise why this occurs ???

Also as the mcu runs on +5 V , I use a 10K and 15K resistor divider to get 3 V for the output ports to the MRF module, the SDO and the INT pins are connected to B0 and B1 pins of the 18f2620 mcu.

The datasheet mentions these pins as TTL buffers, and can detect a high of at least 2.5 Volts.

Is my inference correct ??, or do I have to use a transistor stage to get a +5V high ??

thanks
a


Last edited by arunb on Wed Sep 28, 2011 12:13 am; edited 1 time in total
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Sep 27, 2011 7:31 am     Reply with quote

You could have several problems -but what comes to mind is
not having proper 5v 3.3v translation.

How are you level matching your SPI lines ??
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 27, 2011 1:28 pm     Reply with quote

Quote:
the SDO and the INT pins are connected to B0 and B1 pins of the 18f2620 mcu.

Are you polling the MRF24J40MA INT signal on pin B1, or are you using
the INT1 interrupt capability of Pin B1 ? Do you have #INT_EXT1 interrupts
enabled in your program ?
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Wed Sep 28, 2011 12:13 am     Reply with quote

Sorry for the delay in replying..

I have actually managed to solve the problem, it seems the erratic receive operation was because the interrupts were not being cleared just after initialising the MRF module. Once I did this, the system started to work flawlessly.

Quote:

You could have several problems -but what comes to mind is
not having proper 5v 3.3v translation.

How are you level matching your SPI lines ??


I have a 10K and 15K resistor divider for the PIC output lines, whereas the INT line of the MRf24J40MA module is directly connected to port b0 of the 18F2620 and the SDO is pulled up to 3.3V using a 2.7K resistance and is connected to port b1.

The 3 V supply for the MRf24J40MA module is derived using a LM117 regulator.

Quote:

Are you polling the MRF24J40MA INT signal on pin B1, or are you using
the INT1 interrupt capability of Pin B1 ? Do you have #INT_EXT1 interrupts
enabled in your program ?


I am polling pin b0 for a low state instead of using the external interrupt on b0.

Thanks for the help.

a
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Sep 28, 2011 6:22 am     Reply with quote

"
glad you got it !!
but i'd like to add to those who read this thread -

re: 10K and 15K resistor"

you can get better level translation ( more frequency span)
if you try more divider current / lowwer'Z' by using

2k and 3K as your resistors -

if the frequencies involved are high enough - stray capacitance in parallel with the 15k resistor can provide extra un- intended attenuation.

IMB all passive 3.3/5V translation- especially at significant ( over 500 khz) clock speed -is a bit dodgey
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE;
PostPosted: Thu Sep 29, 2011 8:49 am     Reply with quote

Thanks again, I will change that to 2K and 3K resistors.

I was using the 74VHC08 for level translation, but the IC became unavailable for a long time, so I had to change to resistances.

thanks
a
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group