Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : I2C address below 8
Author | Message | ||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi In the change log from version 5.04.05 " Relaxed error checking on I2C addresses to allow addresses 7 and below to be used" simple test code below tested with ver 5.0501 and ver 5.0502 Master (run when slave is running) Dim a I2C open 50,200 a=9 main: I2C write &H8, 0, 1, A Slave Dim a I2C open 50,200 I2C SLAVE OPEN &H8, 0, 0, i2cWR, i2cREC Main: Pause 30 If MM.I2C <> 0 Then Print "I2c" : Print MM.I2C GoTo Main i2cWR: Print "send" End i2cRec: Print "received" End With 8 or above as the address the result is as expected. When the address is changed to 7 or below the slave never responds. Is this a bug or I have missed something ? Regards Jman |
||||
panky Guru Joined: 02/10/2012 Location: AustraliaPosts: 1094 |
@jman, I tried an MM to MM linkup via I2C under 5.05.02(similar to the demo code Geoff had in the old 5.02 manual) and it also seemed to not recognise address &H7 but worked fine with &H8. Looking at the I2C doco on the web, it does appear that addresses under &H8 are reserved anyway so they should probably not be used except for their special, intended purposes. panky ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9059 |
Yes, that is my understanding too. I2C addresses are not something that you have TOTAL control over. Most devices have their I2C addresses fixed with an agreement with whoever looks after the I2C spec these days(still Philips/NXP?). You normally can only select from a few specific addresses within a range for that device. Take the common EEPROM chips - they are mostly address 1010xxx with the last bit being the R/W bit. Therefore, addresses can be between 1010000 and 1010111 only. &h50 - &h57 in HEX. 80 - 87 in Decimal. Any other address will be ignored with those EEPROM's. They ARE a very common slave address arrangement though, so perhaps you could just use the EEPROM slave address set? IE: set the MM slave address as if it was an EEPROM chip - 1010000. Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5898 |
The AS3935 lightning detector uses address 0 to 3 so they defy the rule. It is my playing with this chip that prompted Geoff to relax the rule. The chip isn't much use anyway. I haven't tried the chip with the recent MMBasic versions. Jim VK7JH MMedit MMBasic Help |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Looks like in Master mode address's below 8 work but not in slave mode. I have an LCD that allows control via I2C but the LCD is the master so I need to make the Mite the slave with address 2. I realize that we should not use address's below 8 but I have no choice in this case. and as the rule is now relaxed I was hopeful :) Tried this with an Arduino and it works but would really like to use a Mite for the job. Regards Jman |
||||
Print this page |