help reading adxl312


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    21

    Default Re: help reading adxl312

    sorry i messed up the test results, this is the result i got, tested it twice

    test program
    test:
    high porta.0
    pause 500
    low porta.0
    pause 500
    goto test

    result at osc 48
    led on off duration is exactly 1 second

    result at osc 20
    led on off duration is twice

    so i think define osc is correct.

    i found this code(in document section) from sparkfun:http://www.sparkfun.com/products/9814
    it is for adxl345 and uses spi but its in c and for atmega..

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: help reading adxl312

    Well I am sorry it wasn't as simple as the clock being wrong, But now you know how to test it. I actually do this on all my programs before going any further just to verify the clock/osc and me are all at the same speed.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default Re: help reading adxl312

    The SHIFTOUT command sends 8-bits unless otherwise specified.
    To send a 16-bit constant, you'll need to specify the number of bits.

    shiftout data_out, CLOCK, 2, [%0011000100100000\16]
    DT

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts