|
|
View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 30, 2008 3:33 pm |
|
|
Quote: | #use i2c(SLAVE,FAST,SDA=PIN_B1,SCL=PIN_B4,address=0x02, force_hw) |
On page 16 of the i2c specification, there is a table of reserved slave
addresses. They are shown in 7-bit format. Address 0x02 is assigned
to the CBUS. In the Notes, it says this:
Quote: | The CBUS address has been reserved to enable the
inter-mixing of CBUS compatible and I2C-bus
compatible devices in the same system. I2C-bus
compatible devices are not allowed to respond on
reception of this address. |
Don't use address 0x02 for the slave.
You should use an even address in this range: 0x10 to 0xF6.
Here is a link to the i2c specification:
http://www.nxp.com/acrobat_download/literature/9398/39340011.pdf
Quote: | #use i2c(SLAVE,fast, sda=PIN_C4, scl=PIN_C3, address=0xC1, force_hw,stream=I2CS) |
Don't use an odd address for the slave. Use an even numbered address
such as 0xC0 or 0xC2. |
|
|
CF_878
Joined: 28 Oct 2008 Posts: 2
|
|
Posted: Thu Oct 30, 2008 4:29 pm |
|
|
Hi all,
I've tried what you recommended but the problem persists. I also tried using this code:
http://www.ccsinfo.com/forum/viewtopic.php?t=33950
But the same happens. I can send whatever I want to the first slave but then the second one won't receive nothing. I mean, If as an example I send something to address 0xC4 and then I want to send something to the address 0xC2, 0xC2 won't receive nothing. It is proteus? Do you have any code that you know it is working well?
Thank you all! |
|
|
Ttelmah Guest
|
|
Posted: Fri Oct 31, 2008 3:22 am |
|
|
If you do a search here, for Proteus and I2C, you will find a lot of posts with people having various problems, especially when dealing with slave mode. I'm afraid that Proteus, while 'pretty good', does not handle this type of thing that well, and especially when things start to get a bit more complex, is not the way to find out if things will really work.
Best Wishes |
|
|
CF_878
Joined: 28 Oct 2008 Posts: 2
|
|
Posted: Fri Oct 31, 2008 4:24 am |
|
|
OK I will test it in my hardware. I thought Proteus fixed that problems.
Thank you for your time and help! |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|