'Sequential i2c code'
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
I'm looking for some code that would take (for example) as inputs:
then the routines
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.
|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:
<code that addresses the device here>
<code that sends data to the device here>
<code which makes stop bit here>
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
Theta Digital Corp.
| ____ ____ |
|/| | | | | |\|
| | |/| |\| | |
| | | | | | | |
| |_/ | | \_| |
| | | | | |
|_/ /___\ \_|
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
look at the an554, they do exactly this.
More... (looser matching)
- Last day of these posts
- In 1999
, 2000 only
- New search...