Go to Post Sir, you vastly underestimate the destructive power of a teenager. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2010, 15:39
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
I2C - Current Address Read

The I2C library Read() code is

Code:
Synchronized sync(m_semaphore);
m_module->m_fpgaDIO->writeI2CConfig_Address(m_deviceAddress, &status);
m_module->m_fpgaDIO->writeI2CConfig_BytesToWrite(sizeof(registerAddress), &status);
m_module->m_fpgaDIO->writeI2CConfig_BytesToRead(count, &status);
m_module->m_fpgaDIO->writeI2CDataToSend(registerAddress, &status);
UINT8 transaction = m_module->m_fpgaDIO->readI2CStatus_Transaction(&status);
m_module->m_fpgaDIO->strobeI2CStart(&status);
while(transaction == m_module->m_fpgaDIO->readI2CStatus_Transaction(&status)) taskDelay(1);
while(!m_module->m_fpgaDIO->readI2CStatus_Done(&status)) taskDelay(1);
data = m_module->m_fpgaDIO->readI2CDataReceived(&status);
I'm not sure, but that appears to be a I2C Random Address Read protocol.

Does anyone have I2C code for Current Address Read?

Start -> Address|1 -> Ack -> Data -> No Ack -> Stop
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2010, 01:20
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: I2C - Current Address Read

Quote:
Originally Posted by oddjob View Post
I'm not sure, but that appears to be a I2C Random Address Read protocol.

Does anyone have I2C code for Current Address Read?

Start -> Address|1 -> Ack -> Data -> No Ack -> Stop
The current implementation will read "count" bytes without reinitializing.

So you want to read without sending the register address? If that is what you mean, you should be able to simply use the new "Transaction" entry-point in the I2C class and pass 0 for the sendSize. This was added in the update that came out today.

-Joe
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2010, 06:06
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
Re: I2C - Current Address Read

As usual, you are one step ahead. Thanks.

EDIT - any idea if/when the new sources will be posted at firstforge?

Last edited by oddjob : 05-02-2010 at 06:35.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-02-2010, 11:47
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: I2C - Current Address Read

Quote:
Originally Posted by oddjob View Post
EDIT - any idea if/when the new sources will be posted at firstforge?
They have been since yesterday... in SVN anyway.
Reply With Quote
  #5   Spotlight this post!  
Unread 05-02-2010, 11:57
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
Re: I2C - Current Address Read

I was looking at the snapshot area, and the new source zip file didn't make it to there yet.

snapshot

EDIT - there is a new release there, but it looks like it is the update patch, not the source zip file.

Last edited by oddjob : 05-02-2010 at 11:59.
Reply With Quote
  #6   Spotlight this post!  
Unread 05-02-2010, 11:58
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: I2C - Current Address Read

Quote:
Originally Posted by oddjob View Post
I was looking at the snapshot area, and the new source zip file didn't make it to there yet.

snapshot
There now.
Reply With Quote
  #7   Spotlight this post!  
Unread 05-02-2010, 12:01
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: I2C - Current Address Read

Whoops... just put up the team update... not the source... just a few more minutes.
Reply With Quote
  #8   Spotlight this post!  
Unread 05-02-2010, 14:31
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: I2C - Current Address Read

Sorry for the confusion... the source is now posted as a snapshot.
Reply With Quote
Reply


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
ADXL345 using I2C tdidi C/C++ 1 29-01-2010 21:02
i2c output virtuald Programming 16 18-01-2009 19:20
what I2C means? matanost General Forum 6 11-12-2008 16:44
I2C tutorials John Gutmann Electrical 3 30-07-2005 10:44
I2C? John Gutmann Electrical 3 19-07-2005 22:52


All times are GMT -5. The time now is 13:47.

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