Ouch, this took a lot longer to get started than I thought. SPI is meant to be easy right? All my SPI reads from the MRF24J were returning 0xff.
Turns out that, even with the /SS pin disconnected, if you don’t explicitly set it as an output pin in the DDR register, the AVR falls out of SPI mode if it ever goes low.
So, even though the pin is not connected, (I’m using a general IO pin to do chip select on the radio module) nothing worked until I explicitly made it an output.
And now, presto, I can read data from the MRF24J properly now! Now we can finally move on to the rest of this bring up.
(The MRF24J40 is an 802.15.4 module, with a SPI interface. It’s about 6€, vs about 20€ for xbees, and is on a standard 2.54mm pin spacing, instead of xbee’s 2mm spacing)
i want to interface zigbee module mrf24j40ma with atmel atmega8515. can any buddy help regarding progrmming spi of both.??????????? thank u……. as soon as early thamk u once again………!!!!!!!!!!
bhadresh: Try reading part 1, 2, and 3 of my series on using the MRF24J40, as well as the post outlining the arduino library for the MRF24J40. If you can’t get any of that sample code to work, (it should need only pin definition changes for other AVRs) let me know, and we’ll see if we can work something out.