Go to Post That's for us to know, and you to lose sleep over finding out! - Austin [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
  #1   Spotlight this post!  
Unread 02-01-2005, 17:38
CyberWolf_22's Avatar
CyberWolf_22 CyberWolf_22 is offline
Programming and Electrical Mentor
AKA: Allen Gregory
FRC #2587 (Afrobots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Houston, Texas
Posts: 227
CyberWolf_22 is just really niceCyberWolf_22 is just really niceCyberWolf_22 is just really niceCyberWolf_22 is just really nice
I2C Digital Compass Programming

I was looking around Newark InOne and found a digital compass.

I read the data sheet and it looks like it will interface nicely with are Robot Controller.
My only problem is going to be figuring out how to program the I2C interface. I have read the PIC datasheet on using the I2C interface but I have not been able to get a good grasp on how I would go about programming it. Does anyone have any examples of programming this sensor or setting up an I2C interface in general?
__________________
  #2   Spotlight this post!  
Unread 02-01-2005, 18:12
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: I2C Digital Compass Programming

Well you are in luck. There is a prewritten library of I2C functions that comes with the compiler. They are documented in the following link:
http://ww1.microchip.com/downloads/e...ies_51297d.pdf

Also, source code for all of these functions can be found in the C18 install directory assuming you selected it when you installed C18.
__________________
1139 Alumni
  #3   Spotlight this post!  
Unread 02-01-2005, 18:58
Elgin Clock's Avatar
Elgin Clock Elgin Clock is offline
updates this status less than FB!
AKA: the one who "will break into your thoughts..."
FRC #0237 (Black Magic)
Team Role: Mentor
 
Join Date: May 2001
Rookie Year: 2001
Location: H20-Town, Connecticut
Posts: 7,773
Elgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond repute
Send a message via AIM to Elgin Clock
Re: I2C Digital Compass Programming

Compass you say?

http://www.chiefdelphi.com/forums/sh...94&postcount=5

We tried that a few years back. Look for mention of the I.D.A.N. system.
__________________
The influence of many leads to the individuality of one. - E.C.C. (That's me!!)

  #4   Spotlight this post!  
Unread 02-01-2005, 20:52
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,367
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: I2C Digital Compass Programming

Note the accuracy in the data sheet. Don't confuse resolution and accuracy. I've been playing with a PNI compass board. I I've got it working to with in 1deg accuracy. However to get this accuracy the are only 2 readings per second. They're slow devices. Enable the set reset register. The board has to be at least 1.5 away from any motors or solenoids. The more the better.
1 degree of error over the length of a playing field is allot. It may have it's uses.
  #5   Spotlight this post!  
Unread 02-01-2005, 21:21
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: I2C Digital Compass Programming

Quote:
Originally Posted by Gdeaver
The board has to be at least 1.5 away from any motors or solenoids.
1.5 what?
  #6   Spotlight this post!  
Unread 02-01-2005, 21:28
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,367
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: I2C Digital Compass Programming

Feet. More if the motors are under high load. The drill motors really put out magnetic distortions. Cims aren't nearly as bad. Fortunately the magnetic field from the motors is not uniform.
  #7   Spotlight this post!  
Unread 03-01-2005, 00:14
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: I2C Digital Compass Programming

Quote:
Originally Posted by CyberWolf_22
...My only problem is going to be figuring out how to program the I2C interface. I have read the PIC datasheet on using the I2C interface but I have not been able to get a good grasp on how I would go about programming it. Does anyone have any examples of programming this sensor or setting up an I2C interface in general?
The hardware I2C interface is unavailable because the Master Synchronous Serial Port Module is being used for the intraprocessor SPI link.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #8   Spotlight this post!  
Unread 03-01-2005, 00:20
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: I2C Digital Compass Programming

Quote:
Originally Posted by Kevin Watson
The hardware I2C interface is unavailable because the Master Synchronous Serial Port Module is being used for the intraprocessor SPI link.

-Kevin
Hrmm... True... This will make things harder but not impossible. You will not be able to take advantage of the built in hardware and will have to "bitbang" the I2C interface. The good new is that I2C is synchronous and so timing isn't critical. If you look in the document i listed earlier, you will see that they have some basic I2C bitbanging functions described in section 3.5.
__________________
1139 Alumni
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
Programming - Getting Started Mark McLeod Programming 80 16-04-2008 23:37
Digital Caliper as a Digital Readout on Small Mill sanddrag Technical Discussion 9 13-10-2005 22:51
Dynamic Input/Output Changing Paolo Control System 6 23-09-2004 19:09
Robot Programming Education phrontist Programming 11 03-05-2004 07:32
heres the code. y this not working omega Programming 16 31-03-2004 15:18


All times are GMT -5. The time now is 03:12.

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