Hi,
I'm READing a compass module AK8963C with a PIC 18F46K20.
To READ the DATA, the DRDY_PIN has been tracked to a PIN on the PIC.
In the program I have:
---------------------------------------------------------
In the set-up is:
Symbol drdy_pin = RD.1
or
Symbol drdy_pin = PORTD.1
================
compss_cs = 0 'COMPASS ON
While not drdy_pin 'AK8963C DRDY PIN
Wend
rd_adr = 0x80 'READ 0x00 %10000000
WaitUs 1
SSPBUF = rd_adr
While Not SSPSTAT.BF
Wend
xhb_raw = SSPBUF
compss_cs = 1 'COMPASS OFF
--------------------------------------------------
No matter what I do, the program stops if I add 'NOT' but carries on if I leave 'NOT' out. Is this correct?
When a statement says e,g, WHILE PIN, does it mean while the PIN is HIGH or LOW, it isn't clear.
Cheers, Camerart.
I'm READing a compass module AK8963C with a PIC 18F46K20.
To READ the DATA, the DRDY_PIN has been tracked to a PIN on the PIC.
In the program I have:
---------------------------------------------------------
In the set-up is:
Symbol drdy_pin = RD.1
or
Symbol drdy_pin = PORTD.1
================
compss_cs = 0 'COMPASS ON
While not drdy_pin 'AK8963C DRDY PIN
Wend
rd_adr = 0x80 'READ 0x00 %10000000
WaitUs 1
SSPBUF = rd_adr
While Not SSPSTAT.BF
Wend
xhb_raw = SSPBUF
compss_cs = 1 'COMPASS OFF
--------------------------------------------------
No matter what I do, the program stops if I add 'NOT' but carries on if I leave 'NOT' out. Is this correct?
When a statement says e,g, WHILE PIN, does it mean while the PIN is HIGH or LOW, it isn't clear.
Cheers, Camerart.