Gyro L3G4200D Code Request


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Nov 2007
    Location
    West Covina, CA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: Gyro L3G4200D Code Request

    Hey Fritz,

    Cool project, close to the crash sensor I was working on.

    It sounds as though there's nothing in the buffer to give, causing it to stay there. Now what would keep the gyro from actually working? CTRL_REG1 bits 2:0 enable/disable the 3 axes.

    Busy looking at datasheet.....

    Do you get an interrupt output signal at DRDY or INIT indicating the device is updating?

    Edit:
    I looked at the code I provided and noticed that I stopped using the INT1 and DRDY outputs, bits 7 and 3. So you'll have to set these in order to verify data updates.
    Besides the typos, I see a few discrepancies within the comments and actual SSPBUF values so confirm what you need to use, sorry about that.
    Code:
    ' Load CTRL_REG3: 10000000, INT1_G enabled, no Boot Status, Active High,
    ' Push-pull output. INT2_G disabled
    GOSUB Start_Gyr        ' Adresss the device
    SSPBUF = $22           ' Transmit register address
    WHILE SSPSTAT.2: WEND  ' Wait until MSSP module finishes task
    SSPBUF = %00000000     ' Transmit the 8bit data to register
    WHILE SSPSTAT.2: WEND  ' Wait until MSSP module finishes task
    PIR1.3 = 0             ' Clear interrupt flag
    GOSUB Stop_I2C         ' Complete TX data
    Last edited by LinkMTech; - 6th March 2015 at 02:58. Reason: More info
    Louie

Similar Threads

  1. am I being rude to ask this. . .ASM code request
    By camcompco in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 11th March 2013, 12:54
  2. 16F877A and Gyro algorithm question
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd February 2012, 23:21
  3. A Defines Request
    By Kirk Fraser in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 31st March 2011, 23:23
  4. How to tell there is a serial request
    By cncmachineguy in forum Serial
    Replies: 4
    Last Post: - 21st November 2010, 22:14
  5. Code request....18f2550 usb/serial
    By f_lez in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st November 2009, 14:26

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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