Olimex Support Forum

Microcontrollers => PIC => Topic started by: v_savov on April 15, 2013, 03:37:29 PM

Title: PIC32-MX460LCD
Post by: v_savov on April 15, 2013, 03:37:29 PM
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! :)
Title: Re: PIC32-MX460LCD
Post by: LubOlimex on April 22, 2013, 04:16:45 PM
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 (http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00091417.pdf)?

Best regards,
Lub/OLIMEX
Title: Re: PIC32-MX460LCD
Post by: v_savov on May 29, 2013, 10:40:45 PM
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!