Go to Post We figured it out. - benjiengi [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Spotlight this post!  
Unread 25-04-2009, 10:57
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: anyone else use the I2C bus?

We used the I2C bus for our LCD menu system. Our display was purchased from New Haven Display. This was the only device we attempted to use.

Quote:
Originally Posted by Dave Flowerday View Post
1) The I2C driver in WPIlib forces you to use a certain I2C "protocol" where the register address is always sent and then you can read or write up to 4 bytes. I would have preferred if it didn't impose this register address protocol on us (there's no reason in our application that we couldn't have issued a read without first writing a register address). This wouldn't impact you though since the Devantech sensors appear to use this fairly-standard protocol.
We had a rather difficult time with this as well. From what I noticed, we could only send a register address and one byte of data. The LCD we used doesn't follow this scheme, but we were lucky in that every command starts with a 0xFE byte followed by another byte to identify the command. We just used 0xFE as the register address, so it looked like this:

Code:
...
	static const UINT8 kCommandPrefix = 0xFE;
...

/**
 * Send a command (without any parameters) to the LCD.
 * 
 * @param command The command to send.
 */
void LCD::SendCommand(UINT8 command)
{
	m_i2c->Write(kCommandPrefix, command);
}

From there on, we could only send a limited amount of commands (only those that did not require any parameters). Rather than asking the LCD to move the cursor to a specific location we had to keep sending move right/left commands. Also, text could only be written 2 characters at a time.

In the end, it did work, but it's kind of sloppy. I'm hoping that the I2C driver will become a little more flexible in the future.
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
 


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