Post Go back to editing

help reading adxl312 (spi 4 wire)

Thread Summary

The user is experiencing issues reading acceleration data from the ADXL312 using a PIC18F4550 microcontroller with PICBasic. The final answer indicates that the user should seek support from the Analog Devices support team, as EngineerZone does not currently provide a community for ADXL312. The accompanying answer suggests visiting the Analog Devices support website for further assistance.
AI Generated Content
hi,

i am having trouble reading acceleration data from adxl312, this  accelerometer can be read/write similar to adxl345.
below is my code, it doesn't work,  no matter how much i shake it i get only 0 reading. i would really  appreciate any help..
i am working with picbasic/pic18f4550

thanks

include "modedefs.bas" DEFINE OSC 48 rx var porta.3 tx var porta.4 data_in var porta.5 data_out var porte.0 CLOCK var porte.1 cs var porte.2 adxl_data_x0 var word adxl_data_x1 var word pause 100 high CS SEROUT tx,T9600,["ADXL 312 Test...",10]     high CLOCK     low cs     shiftout data_out, CLOCK, 2, [%0011000100100000]     high cs      high CLOCK     low cs     shiftout data_out, CLOCK, 2, [%0010111010000000]     high cs              high CLOCK     low cs     shiftout data_out, CLOCK, 2, [%0010111100000000]     high cs     high CLOCK     low cs     shiftout data_out, CLOCK, 2, [%0010110000001010]     high cs     high CLOCK     low cs     shiftout data_out, CLOCK, 2, [%0010110100001000]     high cs     main:     pause 10            high CLOCK     low cs     shiftout data_out, CLOCK, 2, [%10110011]     shiftin data_in, CLOCK, 6, [adxl_data_x1\13]     high CS     high CLOCK     low cs     shiftout data_out, CLOCK, 2, [%10110010]     shiftin data_in, CLOCK, 6, [adxl_data_x0\13]     high CS               SEROUT tx,T9600,["START",10]     SEROUT tx,T9600,[#adxl_data_x0,10]     SEROUT tx,T9600,[#adxl_data_x1,10]     SEROUT tx,T9600,["END",10] goto main

Thread Notes

  • Hi pranavp-


    I’m sorry, EngineerZone doesn’t currently provide a support community for Analog Devices' accelerometer products.  We are planning to continue to add communities that cover other Analog Devices products over time, but for now, to get support on this product I would suggest submitting your question to the Analog Devices support team in your region.  You can find the appropriate support contact on our website at: http://www.analog.com/support


    Regards,
    AndyR
    EngineerZone Community Manager

  • This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.