Searching \ for 'Sequential i2c code' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/i2cs.htm?key=i2c
Search entire site for: 'Sequential i2c code'.

Truncated match.
PICList Thread
'Sequential i2c code'
1999\03\30@091013 by Dave Hoch

picon face
Hi. First time on the list. First Question.

I'm looking for some efficient PIC16CXX code that can read and write I2C
EEPROM devices sequentially. All of the ap notes and code out there
(that I have found) read and write single bytes requiring you to always
re-send the I2C device-decode address and the specific address every
time. The problem is that I need to do block transfers fast as I'm using
a 32 Khz xtal and have a whole bunch of stuff I need to do. For this you
need to typically give them a EEADDR and EEDATA and call the WRITE_EE or
READ_EE routine.

I'm looking for some code that would take (for example) as inputs:

EE_START_ADDR
PIC_RAM_START_ADDR
NUM_BYTES_TO_XFER

then the routines

WRITE_BLOCK_TO_EE
READ_BLOCK_FROM_EE

would be called and the block would be transferred, using the I2C's
internal address indexing.

I'm on deadline and would appreciate it if anyone has some assembly to
help me out.

Best Regards,

-Dave Hoch

1999\03\30@092744 by Vincent Deno

flavicon
face
I do have the kind of code you are looking for, but unfortunately, it's
written in Parallax.  But you already have all that is necessary.

Modify the existing code you have now.  Put another label in the
read/write routines right after the section of code that addresses the
memory.  Then, remove the ending (either receiving/sending _ack and
possibly the stop bit)  Example:

I2C_Send_First
       <code that addresses the device here>
I2C_Send
       <code that sends data to the device here>
       ret

I2C_Stop
       <code which makes stop bit here>
       ret

So, the first time you want to send data to the device, you load up the
argument register with the byte to be sent (as well as any other argument
registers you may want) and call I2C_Send_First.  Continue sending more
bytes by calling I2C_Send.  End the whole thing by calling I2C_Stop.

The same approach can be used for reading from the device.  Hope this is
of help.

Regards,

Vince Deno

{Quote hidden}

--------------
Vincent Deno
Design Engineer
Theta Digital Corp.
http://www.thetadigital.com
spam_OUTdenovjTakeThisOuTspamemail.uc.edu
_____________
| ____   ____ |
|/| | | | | |\|
| | |/| |\| | |
| | | | | | | |
| |_/ | | \_| |
| |   | |   | |
|_/  /___\  \_|

1999\03\30@132514 by Gerhard Fiedler

picon face
At 08:07 03/30/99 -0500, Dave Hoch wrote:
>I'm looking for some efficient PIC16CXX code that can read and write I2C
>EEPROM devices sequentially. All of the ap notes and code out there
>(that I have found) read and write single bytes requiring you to always
>re-send the I2C device-decode address and the specific address every
>time. The problem is that I need to do block transfers fast as I'm using
>a 32 Khz xtal and have a whole bunch of stuff I need to do. For this you
>need to typically give them a EEADDR and EEDATA and call the WRITE_EE or
>READ_EE routine.

look at the an554, they do exactly this.

ge

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...