TABSoft-
It took a while for me to try this (the 232 interface chip crashed so no debug data)
What I have tried using SHIFTIN/OUT is as below:
Code:
[B]'MRF initialization here
debug "@ MRF init", 10,13
MRFConfigSel=0 'Select the chip
'Going to try using shiftout before using hardware SPI
for i=0 to 31 'Sets up the index var for data
MRFaddr=(i << 1) 'Shifts address 1 bit to left, automatically gets start,write, and stop bits
SHIFTOUT SDO, SCLK, 1,[MRFaddr,RF_Init_Values[i]] 'send data to register
next i
MRFConfigSel=1 'Deselect the chip
MRFConfigSel=0 'Select the chip
for i = 0 to 7 'Sets up address to read
MRFaddr=((i << 1) || $40) 'Shifts left 1 bit, sets $40 bit, automatically gets start, READ, and stop bits
SHIFTOUT SDO, SCLK, 1,[MRFaddr] 'Address to read
' MRFConfigSel=1 'Deselect the chip
' MRFConfigSel=0 'Select the chip
SHIFTIN SDI, SCLK, 0,[MRFSPIdata] 'Get data from reg
debug "MRF Config data: Register ", hex2 MRFaddr, " Data=", hex2 MRFSPIdata,13
next i
MRFConfigSel=1 'Deselect the chip
However, the data I get back is:
@ MRF init
MRF Config data: Register FF Data=00
MRF Config data: Register FF Data=00
MRF Config data: Register FF Data=00
MRF Config data: Register FF Data=00
MRF Config data: Register FF Data=00
MRF Config data: Register FF Data=00
MRF Config data: Register FF Data=00
MRF Config data: Register FF Data=00
Its got to be staring at me, but I just can't see it..........
Bookmarks