ADIS16250: Help with setting up SPI


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1

    Default ADIS16250: Help with setting up SPI

    Hello, I have two ADIS16250 Gyros from analog. I have spent abu thte last 3 days trying to figure out how to use them, but the datasheet is way too complicated for me. I have tried:

    <code>
    DEFINE OSC 20
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_SPBRG 21 ' 57600 Bauds
    DEFINE HSER_CLOERR 1

    INCLUDE "modedefs.bas"

    Hserout ["ACTIVE",13]

    RST var portd.0
    SCLK var portd.1
    CS var portd.2
    DOUT var portd.3 'data from PIC to Gyro
    DIN var portd.4 'data from gyro to PIC

    temp var word'(2)
    index var word

    High SCLK
    High CS

    pause 1000

    main:
    low CS
    Shiftout DOUT, SCLK, 1, [$04,$00]
    high cs
    pause 100

    low CS
    SHIFTIN DIN, SCLK, 2, [temp\14]
    high CS
    pause 100

    HSEROUT ["Temp: ",HEX temp,13]
    pause 100
    goto main
    </code>

    But, it doesn't work. I would really appreciate it if someone could give me an example, or set me off in the right direction.

    Thanks,
    InitialDriveGTR

  2. #2
    Join Date
    Sep 2006
    Location
    Mexico
    Posts
    47


    Did you find this post helpful? Yes | No

    Default

    Hello, the reset pin must be high or low, try adding RST=1 or RST=0

  3. #3
    Payatronico's Avatar
    Payatronico Guest


    Did you find this post helpful? Yes | No

    Talking no no no

    muchacho amigo mio

    RST must be high, RST=1.
    maybe the problem is the crystal, try with a 4mhz cristal and more slowly speed of comunication, quiza asi se solucione tu problema chico

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Are the data adresses that I am shifting out correct? That is what I think I am doing wrong. I couldn't fully understand the datasheet's SPI output.

    Thanks,
    InitialDriveGTR

  5. #5
    Join Date
    Sep 2006
    Location
    Mexico
    Posts
    47


    Did you find this post helpful? Yes | No

    Default

    The data adresses is ok. However, the ADIS16250 SPI clock speed is 2.5 MHz, you need to decrease your clock speed in order to transfer data between devices.

    Try reading the status register of the ADIS16250 ($3C).

  6. #6


    Did you find this post helpful? Yes | No

    Default

    How does one go about decreasing the SPI clock speed?

    Thanks,
    Benjamin B. Roy

Similar Threads

  1. Winbond ISD1700 Voice Recorder
    By RFEFX in forum mel PIC BASIC Pro
    Replies: 58
    Last Post: - 22nd April 2014, 10:00
  2. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  3. Using SPI with External Interrupts
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th June 2008, 04:08
  4. 16-bit SPI problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th June 2008, 15:42
  5. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 18:31

Members who have read this thread : 0

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