Hi B,A read is immediate. A poll is on a schedule. The read from a poll....is stored in an assigned area, and then updated.
As for "(2)", you can poll the DRDY pin instead of the bit in ST1. By polling the bit, one is reading the register, so reading the register becomes superfluous. Reading the pin does not read the register. Thus, it appears that ST1 must be read, but why?6.4.3.2. Normal Read Sequence
(1) Check Data Ready or not by any of the following method.
- Polling DRDY bit of ST1 register
- Monitor DRDY pin
When Data Ready, proceed to the next step.
(2) Read ST1 register (not needed when polling ST1)
DRDY: Shows Data Ready or not. Not when “0”, Data Ready when “1”.
DOR: Shows if any data has been skipped before the current data or not. There are no skipped data when “0”, there are skipped data when “1”.
You can connect the rdy pin of the compass to a port pin of the PIC and read the state of the pin.Hi B,
I should have said that I'm using Oshonsoft BASIC
What I'm trying to do is POLL BIT0 of the ST1 REGISTER
Here's is how I imagine it would look like (Section of CODE)
_____________________________________________________________________
compss = 0 'CHIP SELECT COMPASS ON
SPISend 0x02 'st1 register
SPIReceive st1
compss = 1 'CHIP SELECT COMPASS OFF
If st1.0 = 1 Then do something '[[[[[[ drdy = BIT0 ]]]]]
_________________________________________________________________________
but in the D/S is says that I don't need to carry out the bit in RED, but 'simply' poll bit '0'
Oshonsoft has rejected: 'DEFINE ST1 as 0x02 DEFINE is not a correct word.
C.
Hi B,I thought it was just a general question. I am not familiar with that basic language, or the chip.
Stick around, there are experts on here.
Hi J,The address should be 0x82, not 0x02
by Jake Hertz
by Jake Hertz
by Jake Hertz
by Jake Hertz