View Single Post
  #3   Spotlight this post!  
Unread 11-03-2015, 18:06
jman4747's Avatar
jman4747 jman4747 is offline
Just building robots
AKA: Josh
FRC #4080 (Team Reboot)
Team Role: CAD
 
Join Date: Apr 2013
Rookie Year: 2011
Location: Atlanta GA
Posts: 419
jman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond repute
Re: Programing VL6180 I2c Sensor I2c

Quote:
Originally Posted by zstreet View Post
Putting a scope on my SDA and SCL lines I have not gotten an acknowledge from the VL6180X yet. Currently I think I might have fried the regulator on my board.

Concerning your issues: the split number takes the high 8 bits and separates it from the low 8 bits but both are in the original format of U16. After the split number subVI you need to convert them to U8 also. Without downloading the I2C VIs I cannot be certain but it should be set up so that the Slave Address that you are putting in as 0x29 needs to be shifted 1 bit to 0x52.
Don't think you fried it that thing has a crazy complex communications setup that wont respond until after a lot of set up has been preformed. Your breakout has a regulator for use with 3-5.5V so if you are plugging directly into the roboRIO/CRio you will l be fine.

The solution I was working on started with setting up an arduino with the working library and checking function of the sensor, then If it worked figure out what that code was doing and mimic it. By that point I had gotten the RIO to write addresses and data in the correct order. Hint: Have an arduino hooked up to the RIO and have it print what it receives to the serial monitor, I can't imagine trying to debug I2C with a scope. I think for this you will need a bi-directional I2C safe level converter: https://www.sparkfun.com/products/12009

In the end I couldn't figure out exactly all the steps and the order of which the arduino handles the amazing amount of initialization steps by reading the example and source files. The other problem was filtering out steps that set up ALS measurement because I don't need that feature. If I had the time and a bit more C++ experience I could do it.

So after a day of fiddling with it I gave up and focused on using a one of the analog SHARP IR proximity sensors for now. I will go back once I have some time later, this thing is a little tough for someone who hasn't used I2C before.

Post your 2013 code and I can look at it. I can write a 2013 example as well.
Attached Thumbnails
Click image for larger version

Name:	Open VL6180 I2c.png
Views:	56
Size:	108.2 KB
ID:	18607  
__________________
---------------------
Alumni, CAD Designer, machinist, and Mentor: FRC Team #4080

Mentor: Rookie FTC Team "EVE" #10458, FRC Team "Drewbotics" #5812

#banthebag
#RIBMEATS
#1620
Reply With Quote