camerart
Well-Known Member
Hi,
Can anyone comment these two examples of SPI code please, I can't see how it works? I'm mainly puzzled by the address being read/writ
Cheers, Camerart.
'SPI=====================================================
'Dim addr As Byte
'Dim data As Byte
'For addr = 0 To 10
'data = 200 - addr
'SPICSOn
'SPISend 0x06
'SPICSOff
'SPICSOn
'SPISend 0x02
'SPISend addr
'SPISend data
'SPICSOff
'Lcdcmdout LcdClear
'Lcdout "Write To EEPROM"
'Lcdcmdout LcdLine2Home
'Lcdout "(", #addr, ") = ", #data
'WaitMs 500
'Next addr
'For addr = 0 To 10
'SPICSOn
'SPISend 0x03
'SPISend addr
'SPIReceive data
'SPICSOff
'Lcdcmdout LcdClear
'Lcdout "Read From EEPROM"
'Lcdcmdout LcdLine2Home
'Lcdout "(", #addr, ") = ", #data
'WaitMs 500
'Next addr
Can anyone comment these two examples of SPI code please, I can't see how it works? I'm mainly puzzled by the address being read/writ
Cheers, Camerart.
'SPI=====================================================
'Dim addr As Byte
'Dim data As Byte
'For addr = 0 To 10
'data = 200 - addr
'SPICSOn
'SPISend 0x06
'SPICSOff
'SPICSOn
'SPISend 0x02
'SPISend addr
'SPISend data
'SPICSOff
'Lcdcmdout LcdClear
'Lcdout "Write To EEPROM"
'Lcdcmdout LcdLine2Home
'Lcdout "(", #addr, ") = ", #data
'WaitMs 500
'Next addr
'For addr = 0 To 10
'SPICSOn
'SPISend 0x03
'SPISend addr
'SPIReceive data
'SPICSOff
'Lcdcmdout LcdClear
'Lcdout "Read From EEPROM"
'Lcdcmdout LcdLine2Home
'Lcdout "(", #addr, ") = ", #data
'WaitMs 500
'Next addr