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 Problem with Micromite
Page 1 of 2 | |||||
Author | Message | ||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 813 |
Hi to all! I have a sensor with this address which I want to read out with a Micromite V5.05.05: But I get always this error: [26] I2C READ &H78, 0, 4, temp() Error : Invalid address It seems that all addresses from &H77 generate this error... What's going on here? Can anybody help me? THANKS! Frank |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8578 |
It is what is coded in the Micromite firmware, as to why?...... The PicoMite doesn't have the limitation Edited 2022-01-14 23:53 by matherp |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2285 |
typing "i2c reserved addresses" (without quote marks) into google reveals: "A seven bit wide address space theoretically allows 128 I2C addresses - however, some addresses are reserved for special purposes. Thus, only 112 addresses are available with the 7 bit address scheme. To get rid of this a special method for using 10 bit addresses is defined. The following table shows I2C addresses reserved for special purposes: 0000000 0 General Call 0000000 1 Start Byte 0000001 X CBUS Addresses 0000010 X Reserved for Different Bus Formats 0000011 X Reserved for future purposes 00001XX X High-Speed Master Code ... 11110XX X 10-bit Slave Addressing 11111XX X Reserved for future purposes" from: https://www.i2c-bus.org/addressing/ what exactly is the device you have that has address 0x78? cheers, rob :-) Edited 2022-01-15 01:37 by robert.rozee |
||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 813 |
@robert.rozee: It's a pressure Sensor from Wuerth Elektronik: Wuerth pressure sensor THANKS! I had forgotten that there are "i2c reserved addresses"... What was Wuerth Elektronik thinking??? Frank |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
Shouldn't that address be &HF1 (write) Hex not Octal? Bill Keep safe. Live long and prosper. |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 1781 |
At which end is the extra "0" meant to go? MSB or LSB? > ? hex$(&B01111000) 78 > ? hex$(&B11110000) F0 > |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
From the data sheet the extra bit is the LSB '1' for read. Bill Keep safe. Live long and prosper. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5898 |
From the MMBasic manuals: The MMBasic manuals don't describe the "reserved" range which this device seems to use. Jim VK7JH MMedit MMBasic Help |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3654 |
The PDF is clear: 7-bit address 78 (hex). Rather odd. John |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
This tells me 7 bit plus LSB. I still read it as &HF1. Am I mis-reading it somehow? Bill Keep safe. Live long and prosper. |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 5714 |
I wonder if they are using old silicon that predates the introduction of 10-bit addressing? They wouldn't want to change it later as anything designed to work with the old one would break - you couldn't use a new unit as a spare for an old one. They almost certainly wouldn't use that address now. In a word, yes. You're misreading it. 111 1000 is the address, followed by an extra 0 for write or 1 for read IIRC. 7-bit addressing. Unfortunately 111 10xx is the reserved code to introduce a 10-bit address so that 10-bit units will work on a 7-bit system. Edited 2022-01-15 08:44 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
OK, it's a seven bit ADDRESS followed by a '1' bit for 'read'. Does that mean that you DON'T send it '11110001' to issue a read command for that address? Bill Keep safe. Live long and prosper. |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 5714 |
Yes, you do. You are then supposed to tag on the *actual* 10-bit address. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 5714 |
This might help. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
Thanks, reading Jim's quote from the manual shows I need to read up on the subject a bit more. Sorry if I added to any confusion. Bill Keep safe. Live long and prosper. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5898 |
There was discussion about this some years ago when another device appeared to use a "reserved" address. If I remember correctly (a dangerous assumption), that device had a pin to change the address which did allow it to use valid address, just only one such device on the same data lines. I think Arduino code allows the bad addresses. Jim VK7JH MMedit MMBasic Help |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
Any chance that the CFunction I2CPort might work? Bill Keep safe. Live long and prosper. |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2285 |
the wuerth datasheet links to a philips datasheet, which reads: "Assignment of addresses within a local system is up to the system architect who must take into account the devices being used on the bus and any future interaction with other conventional I2C-buses. For example, a device with seven user-assignable address pins allows all 128 addresses to be assigned. If it is known that the reserved address is never going to be used for its intended purpose, a reserved address can be used for a target address." (page 16, my highlighting) from: https://www.nxp.com/docs/en/user-guide/UM10204.pdf so wuerth should have been aware that they were using a reserved address, as well as being aware that if they really wanted to they could make use of it at the cost of being 10-bit addressing incompatible. it may be worth asking Geoff if it is possible to extend the range of allowed addresses on the MX170 et al versions of MMbasic. i do not fully know how this may affect the support of 10-bit addressing in the firmware, but i suspect that the presence of an 8/10-bit flag in the function calls precludes major problems. i do note that the pico version of MMbasic seems to have had reference to 10-bit addressing removed from the user guide at least. Peter may care to comment about the availability of 10-bit addressing here. note that it does appears that 10-bit addressing never really took off within the industry, so its absence may be of little concern. cheers, rob :-) Edited 2022-01-15 14:26 by robert.rozee |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
OK, I will do that in the next release (it does not affect anything else). Note that the CRoutines library in the Micromite distribution ZIP contains the CFunction I2CPort() which will create additional I2C ports and that does not have any limitations on the address range. Geoff Geoff Graham - http://geoffg.net |
||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 813 |
Thank you so much to all!!! I will try CFunction I2CPort... Frank |
||||
Page 1 of 2 |
Print this page |