Project:HM55B: Difference between revisions

From London Hackspace Wiki
Line 55: Line 55:
Note that &:50000 isn't enough of a delay, but && works, presumably because BusPirate parser adds a huge delay.  This means that we don't know how fast this module can be clocked, because each ! will be > 50ms apart.
Note that &:50000 isn't enough of a delay, but && works, presumably because BusPirate parser adds a huge delay.  This means that we don't know how fast this module can be clocked, because each ! will be > 50ms apart.


We could test this with:
The [http://dangerousprototypes.com/docs/SPI BusPirate wiki] suggests this will work (since we've determined that it still provides the 22 sample bits even if the reading is incomplete):
 
\[0b0000 &]
[0b1000 && ]&[& 0b1100 r:4]





Revision as of 00:12, 3 September 2010

Module

$20-25 compass module for embedded systems. SMD will be cheaper.

Datasheet


Testing with the BusPirate

BusPirate settings:

  • M (mode)
  • 8 (3-wire raw)
  • 4 (400KHz)
  • 2 (3.3V high)
  • W (turn on 5V output)

Reset:

\[/_\/_\/_\/_\&:10]

The delay may not be needed.

Take sample (1100 is the response for success, 00xx is for incomplete, xx11 is error, see p9 of datasheet)

\[/-\/_\/_\/_\&&]&:10[&:10/-\/-\/_\/_\!!!!&!!!!!!!!!!!&!!!!!!!!!!!]
READ BIT: 1
READ BIT: 1
READ BIT: 0
READ BIT: 0
DELAY 0b00000001uS
READ BIT: 0
READ BIT: 0
READ BIT: 0
READ BIT: 0
READ BIT: 0
READ BIT: 0
READ BIT: 1
READ BIT: 0
READ BIT: 0
READ BIT: 0
READ BIT: 0
DELAY 0b00000001uS
READ BIT: 1
READ BIT: 1
READ BIT: 1
READ BIT: 1
READ BIT: 1
READ BIT: 1
READ BIT: 1
READ BIT: 1
READ BIT: 1
READ BIT: 0
READ BIT: 0

Note that &:50000 isn't enough of a delay, but && works, presumably because BusPirate parser adds a huge delay. This means that we don't know how fast this module can be clocked, because each ! will be > 50ms apart.

The BusPirate wiki suggests this will work (since we've determined that it still provides the 22 sample bits even if the reading is incomplete):

\[0b0000 &]
[0b1000 && ]&[& 0b1100 r:4]


Sample values:

0,-6

-1,-11

-1,-19