Hello,
I have any problem with my code.
I am working with HMC6352 in PROTON but i have any problem with the sensor. I don`t know what happen, Please could you help me?
This is the code
device = 16f876
xtal 20
declare SDA_PIN PORTB.0
DECLARE SCL_PIN PORTB.1
DIM LSB AS WORD
DIM MSB As WORD
Main:
BusouT $42,[$43]
DELAYUS 10
DELAYMS 10000
BUSOUT $42,[$45]
DELAYMS 14
BUSOUT $42,[$4F]
DELAYMS 6
while 1=1
busout $42,[$41]
delayms 10
busin $43,[MSB, LSB]
HRSOUT "VALOR MSB ", DEC mSB, "LSB ", DEC LSB, 13
DELAYMS 500
wend
GOTO mAIN
The problem is that LSB date is incorrect. It is not read. Always show 65535 as value of LSB.
Bookmarks