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
Bookmarks