November 23, 2024, 12:28:11 PM

PIC32-MX460LCD

Started by v_savov, April 15, 2013, 03:37:29 PM

Previous topic - Next topic

v_savov

Hi Olimex, can you help me with the Accelerometer init in your demo?
From the demo source with YOUR .hex file everything is OK but after building the demo project and programming the device the function "Accl_init" does not work properly. To be more precise the function "I2CSetFrequency" from the I2C drivers does not set the freq. I'm debugging and watching the registers with PIC-KIT3 and MPLAB, and the value in I2C1BRG is not the right. Also the function doesn't return the right value. Can you help me fix that?
Thankyou! :)

LubOlimex

Hey v_savov,

Have you modified the code? Does it compile fine at your side (if there are errors or warnings please quote them)? Which version MPLAB and which exact compiler you use to generate the code?

Did you stumble upon the datasheet of the accelerometer: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00091417.pdf?

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

v_savov

I didn't modify the code, it does compile fine, MPLAB v8.80, MPLAB PIC32 C Compiler.
Maybe the project and the .hex file are different. I'm trying to fix the code, bud I think it will be better for me to write a new init for the i2c and accl. Can you give me another idea for fixing.
Thankyou!