HI2C and Setfreq issue

dj_trippn

New Member
I know there must be a simple answer to this question, but I cannot find it anywhere.

I have an application where I have 2 x 28X1's. One is setup as the master using the HI2C command: "hi2csetup i2cmaster, %11001000, i2cfast, i2cword"

The second is the slave "HI2CSETUP I2CSLAVE, %11001000"

The slave is using Setfreq m8, and the problem I am having is the master can only talk to the slave if it's frequency is set at Setfreq m2. If I set the master to Setfreq m8 it will not talk to the slave. This is obviously causing me problems because I need the master to run faster.

Does anyone know what could be causing this problem?

Are you allowed to run the HI2COUT command when running at m8 speed?
 

hippy

Ex-Staff (retired)
First thing I'd try is ...

hi2csetup i2cmaster, %11001000, i2cslow_8, i2cword

Also, shouldn't that i2cword be an i2cbyte ?
 

dj_trippn

New Member
Hi Hippy thanks for your reply.

Changing to the i2cslow_8 fixed my problem. I did not actually know about using this, so I re-read the instruction manual and found where they mention this. I somehow skipped it while reading the manual.

Regarding using i2cbyte instead of i2cword, I am abit confused. I originally was only talking to a 24LC256 chip via I2C so there used i2cword. Since I added the PICAXE slave on the bus I havn't changed it and it still works perfectly. If I change it to i2cbyte, then I get unexpected errors in the data sent to the PICAXE slave. I know every example I have seen using PICAXE to PICAXE I2C they have used i2cbyte, but the only HI2C example I have seen was Tarzan's and he used i2cword. Is there anywhere in the documentation that specifies what mode and address length you should use with a picaxe slave?

Once again thanks for pointing out the i2cslow_8 variable to me, I have changed to i2cfast_8 and this is working fine also.
 

westaust55

Moderator
Here are a couple from several past posts on this topic by Technical

http://www.picaxeforum.co.uk/showthread.php?t=10583&p=78516

http://www.picaxeforum.co.uk/showthread.php?t=8381&p=55904


Regarding using i2cbyte instead of i2cword, I am abit confused. I originally was only talking to a 24LC256 chip via I2C so there used i2cword. Since I added the PICAXE slave on the bus I havn't changed it and it still works perfectly. If I change it to i2cbyte, then I get unexpected errors in the data sent to the PICAXE slave. I know every example I have seen using PICAXE to PICAXE I2C they have used i2cbyte, but the only HI2C example I have seen was Tarzan's and he used i2cword. Is there anywhere in the documentation that specifies what mode and address length you should use with a picaxe slave?

Once again thanks for pointing out the i2cslow_8 variable to me, I have changed to i2cfast_8 and this is working fine also.
the i2cword versus i2cbyte relates to the addressing scheme. Some chips such as larger EEPROM require two bytes (a word) to provide the full adression for a memory location) but many chips only need one byte hence the two keywords (i2cbyte and i2cword).

All data sent throuugh the i2c comms bus from a PICAXE has the data sent in bytes.
 
Last edited:
Top