I'm trying this for the first time with the new library and I need to determine that my hardware hookup is capable of working. Does anyone have any known working code for this? For instance, something that scans the bus and returns the address of connected devices.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using the demo file "I2C Hardware Discovery to Terminal". My device is an MCP4018 digipot addressed at 2F. The demo program is detecting it at 5E and 5F. Is that a bug or is there something more I should know about how this library works?
Joe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@joe. Are you willing to create a library for the MCP4018 ?
Use I2CEEPROM.h as an example if you are willing. The addition of the test of HIC2 and IC2 will ensure we can use the library for software and hardware I2C.
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Let me see how this goes before I commit to making a specialized part handler. Initial result is that it SEEMS to be controlling the DigiPot, but I need to do more detailed testing. FYI, I made my own TWI handler some time ago for driving an SI570 chip and that worked well. However, I'd like to use 'mainstream' libraries for anything new I do, and this is the first attempt at that. Also FYI, I'm using no external pullups, even at 400 khz, just the internal pullups in the chip enabled.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying this for the first time with the new library and I need to determine that my hardware hookup is capable of working. Does anyone have any known working code for this? For instance, something that scans the bus and returns the address of connected devices.
Demonstrations. :-)
You must have v0.94 the latest hot release.
See https://sourceforge.net/projects/gcbasic/files/Demonstration%20Files/I2C%20Solutions/
I'm using the demo file "I2C Hardware Discovery to Terminal". My device is an MCP4018 digipot addressed at 2F. The demo program is detecting it at 5E and 5F. Is that a bug or is there something more I should know about how this library works?
Joe
I am very please the demonstration worked. This is good news.
0x2F is the 7bit address. If you add the read and write bits to the 7bit address you will get 0x5E and 0x5F for the read/write.
GCB has uses the 8bit address and then and/or the write/read bit as required. Using the 8bit address was the GCB method in the distance past.
So, to write/read use 0x5E and GCB will take care of the rest.
Have a look the DS1307.h - it is a good example.
@joe. Are you willing to create a library for the MCP4018 ?
Use I2CEEPROM.h as an example if you are willing. The addition of the test of HIC2 and IC2 will ensure we can use the library for software and hardware I2C.
Thank you.
More...
Actually, I'm using the last release of GCB (not the hot release) with just the HI2C library from the hot release. Is that valid?
If you are using ATMEL I strongly, very strongly recommend v0.94 - the Hot Release.
Otherwise should be ok. Just review the v0.94 Release Notes to ensure you are not requiring some of the new functionality.
:-)
Let me see how this goes before I commit to making a specialized part handler. Initial result is that it SEEMS to be controlling the DigiPot, but I need to do more detailed testing. FYI, I made my own TWI handler some time ago for driving an SI570 chip and that worked well. However, I'd like to use 'mainstream' libraries for anything new I do, and this is the first attempt at that. Also FYI, I'm using no external pullups, even at 400 khz, just the internal pullups in the chip enabled.