CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

mpu6050 problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jim90



Joined: 27 Apr 2013
Posts: 55

View user's profile Send private message

mpu6050 problem
PostPosted: Sat Jan 04, 2014 6:41 pm     Reply with quote

I am trying to use a mpu6050 component. When i used a program which i found from the forum (to find the address of the register) i received stranger values.
(I expect to see D0, D1 but i receive A6 address).


I think that something is going wrong with my connections so i need your advice. Below i present the connections which i did:

VDD -->connected
GND-->connected
CS
INT1
INT2
SD0
SDA-->connected
SCL-->connected

I need to connect the CS, INT1, INT2, SD0 ?????
temtronic



Joined: 01 Jul 2010
Posts: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jan 04, 2014 8:31 pm     Reply with quote

comment: You should supply a 'link' to whatever datasheet/documentation you have for your device.
It's probably not a 'raw' device but a 'module' that you're using so we need more details.
One item. The mpu-6050 is a '3 volts' device.As such it's easiest to connect with a '3 volt' PIC. These PICs will have 'L' in their part number.
ie: 16LF648, 18LF26K22. To interface to a 5 volt PIC you will need proper 'logic level shifting'.Either using discretes like FETs or an integrated circuit.A quick glance at the Sparkfun website says it's an I2C device,so you may have to 'code' yours to get the proper address.Usually a jumper or two needs to be pulled hi or lo,again the datasheet will explain this.CS could be 'Card Select', active high;INT1,INT2 could be interrupts from the device to the PIC(usually needing pullups) BUT we need more information, specifically the datasheet of the module you're using.

The more data you provide , the better we can help.

hth
jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jan 04, 2014 9:58 pm     Reply with quote

These posts below explain how to connect a 3.3v i2c slave device to a PIC
running at 5v:

With the following method, the master PIC uses software i2c on any i/o pins:
http://www.ccsinfo.com/forum/viewtopic.php?t=48899&start=21

With this method, the master PIC uses hardware i2c, and the slave must
be connected to the hardware SDA and SCL pins on the PIC:
http://www.ccsinfo.com/forum/viewtopic.php?t=51350&highlight=smbus&start=1

The pullup resistors must connect to +3.3v in both methods.
dorinm



Joined: 07 Jan 2006
Posts: 38

View user's profile Send private message

PostPosted: Mon Jan 06, 2014 6:46 am     Reply with quote

your reading is correct, as mpu6050 defaults to "i2c master mode" (internally) in which you'll read only it's address, the acc and magneto will be internally slaves; please read the datasheet carefully about the mode of operation;

edit: read the arduino library and port whatever you need for pic (as it's damn easy Smile ) http://playground.arduino.cc/Main/MPU-6050
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group