Perhaps you need to strip this back to the basics?
Forget trying to configure the MRF registers.
Just try to read them after a POR.
Also, what is your physical connectivity between the PIC and the MRF (Pinouts/Schematic)?
Can you show us your aliases for MRFConfigSel, SCLK, SDO and SDI?
I can't think of any reason why you shouldn't be able to read the config registers.
Using Shiftin/Shiftout for SPI has not been a problem thus far.
Create just a skeleton program to configure the PIC for the connectivity you need to the MRF and Serial port for debug.
Then with the skeleton, just wait for the appropriate amount of time and try to read regs 00 - 07, but do not do this in a For/Next loop. Read each register in a serial fashion.
E.g.
MRFaddr = $40
MRFConfigSel = 0
SHIFTOUT SDO, SCLK, 1,[MRFaddr]
SHIFTIN SDI, SCLK, 0,[MRFSPIdata]
MRFConfigSel = 1
debug "MRF Config data:Register ", bin8 MRFaddr, " Data=", hex2 MRFSPIdata,13
pause 50
MRFaddr = $41
MRFConfigSel = 0
SHIFTOUT SDO, SCLK, 1,[MRFaddr]
SHIFTIN SDI, SCLK, 0,[MRFSPIdata]
MRFConfigSel = 1
debug "MRF Config data:Register ", bin8 MRFaddr, " Data=", hex2 MRFSPIdata,13
pause 50
etc...
Bookmarks