I've spent a while trying to communicate with the RFM12B but still unable to make it work.
Circuit schema is attached.
Checked my connections many times and testing on 2 similar circuits.
Wasn't able to find a decent documentation for the RFM12. only got those 2 PDF published on their site HOPERF.
Now the first step is to make sure that SPI is working and able to communicate with RFM.
the only available command is the status read command (0x0000) which is supposed to return several RFM settings. but am always receiving zeros.
i need to know the following:
1- Is there anything wrong with the schema ? (RFM is powered with 5V)
2- Is there a problem while initializing the SPI or Writing/Reading in the following code (using XC8)
Code C - [expand] |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| TRISC7 = 1;
TRISC6 = 0;
TRISC3 = 0;
TRISC4 = 1;
TRISC5 = 0;
RFM_FSK = 1;
PIE1bits.SSPIE = 0;
OpenSPI(SPI_FOSC_16, MODE_11, SMPMID);
__delay_us(100);
RFM_CS = 0;
WriteSPI(0x0);
RFM_CS = 1;
RFM_CS = 0;
unsigned char xH = ReadSPI();
RFM_CS = 1; |
thank you