Electronic – MRF49XA Microchip Transceiver

communicationtransceiverwireless

Does anyone have any experience with the Microchip MRF49XA sub 1GHz transceiver? I have been trying to get one of these to talk to a pic16f886 over the last week or so over SPI and having no luck getting a response out of it. I have followed the data sheet on the required connections correctly as far as I can tell and I able to send data out on the SDO, but when I pull chip select low and write 0x00 to the SPI output (which should get a response from the MRF49XA status register) the SDI line stays low. I have tried writing all my own code using the data sheet as my source and when that didn't work I downloaded the Sample Demo Application and ripped out the relevant parts from, still no luck.

I have attached a screen shot of a sample of an SPI write cycle, Ch. 1 is the SDO, Ch.2 the chip select line and Ch. 3 the SCK.

SPI logic signals

Suffice to say that when executing the SPI read the SDO is low, the SDI is low (sadly) the chip select (CS) is low and the clock pulses correctly. The MRF49XA uses Word writes so that is why the clock line pulses 16 times with a gap in between where the CS remains low.

If anyone has had any experience with this chip help would be great, some of the articles I have found online have hinted that is can be a pain but nothing has really helped so far.

I am using a PIC16F886 to talk to this thing, running off 3.3V and here are the SPI setup and commands:

 
.
.
.
.

//set up SPI
    SSPCON = 0b00100000;
    SSPSTAT = 0b11000000;
}
void spiWrite(BYTE data)
{
    BYTE i;
    PIR1bits.SSPIF = 0;
    i = SSPBUF;
    SSPBUF = data;
    while(PIR1bits.SSPIF == 0){}
} 
BYTE spiRead(void){
    spiWrite(0x00);
    return SSPBUF;
}   

void RegisterSet(WORD setting)
{
    nCS = 0;
    spiWrite(setting >> 8);
    spiWrite(setting);
    nCS = 1;
}

Best Answer

The demo code is for a PIC18F87J11 and the C18 compiler, whereas you are using a PIC16F886 and some other, probably incompatible, compiler.

You will probably have more success if you use a PIC18 instead of the PIC16F886, with the C18 compiler. I downloaded the code, and apart from having to fix the include file location, the application built without any problems. You are also more likely to get assistance if you use the correct chip and compiler, either from people here, or on the Microchip forum.

Related Topic