Give this a shot.
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 MRFConfigSel=0 'Select the chip ' SHIFTOUT SDO, SCLK, 1,[MRFaddr,RF_Init_Values[i]] 'send data to register SHIFTOUT SDO, SCLK, 1,[MRFaddr,RF_Init_Values(i)] 'send data to register MRFConfigSel=1 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 MRFaddr=((i << 1) | $40) 'Shifts left 1 bit, sets $40 bit, automatically gets start, READ, and stop bits MRFConfigSel=0 'Select the chip 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 MRFConfigSel=1 debug "MRF Config data: Register ", hex2 MRFaddr, " Data=", hex2 MRFSPIdata,13 next i




Bookmarks