Go to Post I hate mini-bots. - Gdeaver [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 27-04-2009, 18:38
skimoose's Avatar
skimoose skimoose is offline
Parent/Mentor/Engineer
AKA: Arthur Dutra
FRC #0228 (GUS)
Team Role: Electrical
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Meriden, Connecticut
Posts: 568
skimoose has a reputation beyond reputeskimoose has a reputation beyond reputeskimoose has a reputation beyond reputeskimoose has a reputation beyond reputeskimoose has a reputation beyond reputeskimoose has a reputation beyond reputeskimoose has a reputation beyond reputeskimoose has a reputation beyond reputeskimoose has a reputation beyond reputeskimoose has a reputation beyond reputeskimoose has a reputation beyond repute
Re: anyone else use the I2C bus?

Quote:
Originally Posted by virtuald View Post
We tried to use an I2C LCD from New Haven to work also, but unfortunately we weren't ever able to get it to work and gave up due to time constraints.
The New Haven display we used needed to have a jumper soldered onto the PCB traces to enable I2C communication. Check the New Haven literature to see if the model you used needed this jumper. The pads were not drilled so you needed to surface solder a very short piece of bare copper wire across the two adjacent pads.
__________________

2009 CT Regional Motorola Quality Award
2010 VRC Connecticut Championship Winners & Amaze Award
2010 VRC Championship Divisional Energy Award
2010 WPI Regional Winner
2010 WPI Regional Engineering Inspiration Award
2011 WPI Regional Chairman's Award
2012 WPI Regional Finalists
  #17   Spotlight this post!  
Unread 27-04-2009, 21:12
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: anyone else use the I2C bus?

Quote:
Originally Posted by Joe Hershberger View Post
I'm surprised you're having trouble... I tested talking to 3 different sensors on the same bus at the same time, using the LabVIEW examples. Are you sure you could address your second sensor at all?

Perhaps you had a wiring problem. Also, the Digital Sidecar has all the needed pull-up resistors. The devices should not have pull resistors in them.



You just didn't consult the correct NI guy. The statement that we didn't expect I2C to be used this year is completely false.



Perhaps you are misinterpreting the interface. The current API to I2C on the FPGA allows you write to one register or read from between 1 and 4 sequential registers. In either case, the device will be addressed, then the register will be addressed, and finally the data will be moved. Only when you're using a device that does not have a register-level I2C API does this scheme not work nicely. You should not use a register write when you are trying to do a register read.

The intention is that it will be more flexible in the future so that other custom API types can be easily supported as well.

Wow… ok I must be overlooking something. Too many people are succeeding so it has to be something in our program. I’ve actually used the I2C bus before. 5 years ago I had three Devantech SRF08’s running from a basic stamp chip so I was aware of the addressing scheme and how to change addresses.
We had both a SRF08 Ultrasonic detector and a CMP-S03 connected to the I2C Bus. We could run the demo for SRF08 and get good readings. Then we wanted to also read the CMP-S03 compass. The compass was our priority so we programmed to read it first, then the SRF08. We got data from the compass but nothing from the SRF08. Pretty much the SRF08 should have been a cut and paste of the demo as we left it at default address. We couldn’t see what we were doing wrong and after an hour of rechecking and trying various things, we had to move on and decided to ask the NI guys at the championship.

One thing about the NI implementation, to read the Devantech CMP-S03 compass you do a write for the register number you want to read but the write doesn’t need a data byte sent. It will output one or two bytes on the next read according to which register you addressed.
I opened up the VI I2C.lvlib:write.vi block diagram and looked at the I2C config, which requires you to send at least one byte of data but it has a password lock so there is no way for me to modify it to write the register number to the device without actually sending a byte of data. I would have to rewrite the vi but there just wasn’t time for that.

Hope I didn’t slander the NI guys. They were really busy trying to be in two places at once.
  #18   Spotlight this post!  
Unread 27-04-2009, 22:03
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,089
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: anyone else use the I2C bus?

Quote:
Originally Posted by skimoose View Post
The New Haven display we used needed to have a jumper soldered onto the PCB traces to enable I2C communication. Check the New Haven literature to see if the model you used needed this jumper. The pads were not drilled so you needed to surface solder a very short piece of bare copper wire across the two adjacent pads.
Yeah, ours had that requirement also. Its possible we soldered the wrong set on accident, however.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #19   Spotlight this post!  
Unread 27-04-2009, 22:19
timmmoore timmmoore is offline
Registered User
FRC #1899
 
Join Date: Mar 2008
Location: Bellevue
Posts: 18
timmmoore is on a distinguished road
Re: anyone else use the I2C bus?

Steve_Alaniz for the CMPS03 you should be able to do a I2C read of 2 bytes from register 2. Haven't tried it but I have one so I will connect it and see.
  #20   Spotlight this post!  
Unread 28-04-2009, 01:00
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: anyone else use the I2C bus?

Quote:
Originally Posted by timmmoore View Post
Steve_Alaniz for the CMPS03 you should be able to do a I2C read of 2 bytes from register 2. Haven't tried it but I have one so I will connect it and see.
Tim
Oh we DID do a two byte read initially, but that was too much resolution for our application so we dropped back to a one byte read.

Steve
  #21   Spotlight this post!  
Unread 03-05-2009, 14:33
timmmoore timmmoore is offline
Registered User
FRC #1899
 
Join Date: Mar 2008
Location: Bellevue
Posts: 18
timmmoore is on a distinguished road
Re: anyone else use the I2C bus?

Steve, I have tried 1 and 2 byte reads on CMPS03 without problem with SRF08 running at the same time.
I also found a way to cause the I2C bus to hang with both devices being accessed at the same time.
Difference
hang: 2 parallel while loops, 1 accessing CMPS03, 1 accessing SRF08
no hang: 1 while loop, accessing SRF08 then CMPS using a sequence

If you remove 1 or the other device physically from the bus but leave the code running both 'work'. But with both connected it may hang - it normally works for a while then hangs the while loop - I would expect this unless the I2C FPGA code has locking behavor for multiple accesses, you would end up with multiple conflicting bus accesses.

So you probably want to put all I2C accesses in 1 thread, store the results in local/global variables and access the variables when needed.
  #22   Spotlight this post!  
Unread 05-05-2009, 01:25
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: anyone else use the I2C bus?

Quote:
Originally Posted by timmmoore View Post
Steve, I have tried 1 and 2 byte reads on CMPS03 without problem with SRF08 running at the same time.
I also found a way to cause the I2C bus to hang with both devices being accessed at the same time.
Difference
hang: 2 parallel while loops, 1 accessing CMPS03, 1 accessing SRF08
no hang: 1 while loop, accessing SRF08 then CMPS using a sequence

If you remove 1 or the other device physically from the bus but leave the code running both 'work'. But with both connected it may hang - it normally works for a while then hangs the while loop - I would expect this unless the I2C FPGA code has locking behavor for multiple accesses, you would end up with multiple conflicting bus accesses.

So you probably want to put all I2C accesses in 1 thread, store the results in local/global variables and access the variables when needed.

Thank you Tim... good information. We'll give it a try.


Steve
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does anyone else use the Dvorak layout? Michael Hill Chit-Chat 12 25-03-2006 23:47
Ultrasonic Rangefinder Operating On I2C Bus CapnBFG Electrical 10 04-06-2005 01:31
Does anyone else NOT use a long arm to place a tetra on top of the Goal? mad_cloversc General Forum 29 08-03-2005 00:44
Anyone else pumped for Bash @ the Beach? rocknthehawk Off-Season Events 24 08-10-2004 16:12
Anyone else irresponsibly overlooked by the judges? archiver 2001 12 24-06-2002 03:31


All times are GMT -5. The time now is 14:01.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi