Whoa! hold on!
In the photos of nano and uno boards I've posted,
portc.5 (a5) is hardware scl and portc.4 (a4) is hardware sda.
Dunno what's going on now!
William sir, I'm taking +5 and ground tof supply to the 6 pin header only as other pins are spi.
I tried with and without 3.8K i2c pullups.
If i2c finder found anything it was F4,F5.
The finder version did seem to loop but the terminal wouls show no device and scroll then find it,,,then lose it...like it was to fast/slow dunno.
Where is code for testing serial out to terminal.
suppose have to number usarts...again not sure how from help.
terminal would be default..usart0? and device usart1?
doh. not seen serial to terminal for this device that works.
serial is 5 bytes and linefeed or summat.
Evan- I will give reading serial 1 more try then post it to you...with a return stamp if 50p
so you can get pissed off like me....I'm that considerate :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had the same results off another "328" i2c finder from your github but this latest seems
specific for 328...although the other had a #chip 328 header.
Unfortunately I tested with ssd1306 as it's i2c and r/w addresses found
but tried tof10120 and nothing found.
this was using same circuit as ssd1306 with 3.8K pullups.
William: It would seem based upon your measurement that the TO1020 has no pullup on the SCL line (Pin6) . Is the measurement on PIN 5 to V+ the same?
Yes, both are around 10M.
William: Originally i2c was intended as a communication protocol between devices on a PCB where traces were relatively short. 10K Pullups were usually sufficient. Adding external leads requires increased source current (lower resistance Pullups) to overcome the added parasitic capacitance and therefore to produce a cleaner waveform.
What can then (with lower resistance Pullups) be the maximum distance ?
When there are even longer leads we should use serial instead?
Stan: Where is code for testing serial out to terminal.
The max distance for an unbuffered I2c Bus is no more than around 2 or 3 meters and then the signal will look pretty rough. Greater distances can be achieved if a Buffer IC is used.
RS232 is generally ok for up to 20 or 30ft. Depending on voltage levels.
For distances over 30 ft or so the industrial standard is RS485/MODBUS.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anobium: I have posted a revised I2C Discovery program for the UNO.
This upgraded code with function comments should give a I2C discovery status, but the options 0 and 2 freezes the terminal and only sometimes work:
0=NON_FOUND: Incorrect I2C ports selected!
1=SUCCESFUL
2=ERROR: Missing PullUp resistors or Check your connnections!
OK. I see.
You need to change the code. Now that you mention the issue..... :-)
Essentially, do all the HI2C code in a block, capturing the status is appropriate variables. Then, after the HI2C code block has completed do the examination of the HI2C status variables.
Why? You are: 1) Holding the IC2 Clock - not good practice. 2) Changing the status the registers and (I think) there is a register shared between HI2C and USART.
Evan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
By using these 3x "HSerPrint" in the HI2CWaitMSSPTimeout?
HSerPrintCRLF
hserprint "ERROR: Missing PullUp resistors or Check your connnections!"
HSerPrintCRLF
It should be sufficient with only I2CsearchStatus=2.
2) Changing the status the registers and (I think) there is a register shared between HI2C and USART.
I can't find any I2C code different with your original.
It also acts the same in both this and the original code seen in the terminal window when I remove the scl or sda wire.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I just get an Windows error ping sound plug-in and plug-out USB.
I tried every option of the tree menu with only response the ping sound.
No error messages at all.
Uninstalled this 64bits version (putty-64bit-0.74-installer.msi) and now installed the putty-0.74-installer.msi.
But still the same ping sound.
Putty doesn't like my pc :-)
Last edit: Haroen 2021-01-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes William, that's it!
I chose the wrong Connection>Serial in the left tree window.
It's the same result as the gcb terminal.
Top section of the jpg is with correct I2C wire connections,
Bottom section is when I removed a I2C wire.
Whoa! hold on!
In the photos of nano and uno boards I've posted,
portc.5 (a5) is hardware scl and portc.4 (a4) is hardware sda.
Dunno what's going on now!
William sir, I'm taking +5 and ground tof supply to the 6 pin header only as other pins are spi.
I tried with and without 3.8K i2c pullups.
If i2c finder found anything it was F4,F5.
The finder version did seem to loop but the terminal wouls show no device and scroll then find it,,,then lose it...like it was to fast/slow dunno.
Where is code for testing serial out to terminal.
suppose have to number usarts...again not sure how from help.
terminal would be default..usart0? and device usart1?
doh. not seen serial to terminal for this device that works.
serial is 5 bytes and linefeed or summat.
Last edit: stan cartwright 2021-01-25
Evan- I will give reading serial 1 more try then post it to you...with a return stamp if 50p
so you can get pissed off like me....I'm that considerate :)
The new i2c finder for 328 I tested with ssd1306 on a nano
Last edit: stan cartwright 2021-01-25
Looks good to me.
I had the same results off another "328" i2c finder from your github but this latest seems
specific for 328...although the other had a #chip 328 header.
Unfortunately I tested with ssd1306 as it's i2c and r/w addresses found
but tried tof10120 and nothing found.
this was using same circuit as ssd1306 with 3.8K pullups.
Evan, I'll post you the device to enjoy it....I've had enough joy using this device.
I can do i2c nano and lgtnano https://www.youtube.com/watch?v=UB3nEY3Jt_w&feature=youtu.be
I unplug the ssd1306 and try the tof10120 but not found.
Last edit: stan cartwright 2021-01-25
Tried with uno and after 16 not found screens gave F4.
This is at 100 or 400 with or without 4K7 resistors
In the i2c finder there's
why isn't it
what's the difference?
Works great!
Yes, both are around 10M.
What can then (with lower resistance Pullups) be the maximum distance ?
When there are even longer leads we should use serial instead?
I only have PICAXE working code that could be tranlated to GCB.
https://picaxeforum.co.uk/threads/tof10120-laser-range-sensor-module.32191/post-335283
The max distance for an unbuffered I2c Bus is no more than around 2 or 3 meters and then the signal will look pretty rough. Greater distances can be achieved if a Buffer IC is used.
RS232 is generally ok for up to 20 or 30ft. Depending on voltage levels.
For distances over 30 ft or so the industrial standard is RS485/MODBUS.
This upgraded code with function comments should give a I2C discovery status, but the options 0 and 2 freezes the terminal and only sometimes work:
0=NON_FOUND: Incorrect I2C ports selected!
1=SUCCESFUL
2=ERROR: Missing PullUp resistors or Check your connnections!
Great job.
When you get a moment - can you download and test https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/blob/b2b03d45abefb94dc17c55d6641f15337137beeb/I2C_Solutions/I2C_Discovery/i2cHardwareDiscovery_to_Terminal_mega328p.gcb
To make sure I did not break anything!
Checked, was OK.
Would be great if someone could find and fix the problem in the code that the options 0 and 2 freezes the terminal and only sometimes work.
Thanks.
OK. I see.
You need to change the code. Now that you mention the issue..... :-)
Essentially, do all the HI2C code in a block, capturing the status is appropriate variables. Then, after the HI2C code block has completed do the examination of the HI2C status variables.
Why? You are: 1) Holding the IC2 Clock - not good practice. 2) Changing the status the registers and (I think) there is a register shared between HI2C and USART.
Evan
It took a few scans to show results for tof10120.
I just posted it to you. 2nd class post.
Last edit: stan cartwright 2021-01-26
By using these 3x "HSerPrint" in the HI2CWaitMSSPTimeout?
It should be sufficient with only
I2CsearchStatus=2.I can't find any I2C code different with your original.
It also acts the same in both this and the original code seen in the terminal window when I remove the scl or sda wire.
OK. Try using Putty as the terminal. Is it the terminal software?
I installed Putty but it doen't want to open the connection.
Last edit: Haroen 2021-01-27
You have to close the other terminal software.
I did close gcb terminal and now the Great Cow BASIC too.
But it doen't want to open the connection.
Windows has locked the Port.
Unplug the USB cable, wait a few seconds and Plug plug it back in.
yes
Sorry, I just get an Windows error ping sound plug-in and plug-out USB.
I tried every option of the tree menu with only response the ping sound.
No error messages at all.
Uninstalled this 64bits version (putty-64bit-0.74-installer.msi) and now installed the putty-0.74-installer.msi.
But still the same ping sound.
Putty doesn't like my pc :-)
Last edit: Haroen 2021-01-28
Verify the com Port in Device Manager. Working ?
Open Putty . At the top click on Session.
Connection Type >>> Serial
Manually Enter "COM7"
Manually Enter the Baud Rate
Click on OPEN at the bottom.
The terminal should open.
Putty is odd and somewhat clunky. You cannot open the terminal from the Serial page
It must be opened from the Session Page.
Yes William, that's it!
I chose the wrong Connection>Serial in the left tree window.
It's the same result as the gcb terminal.
Top section of the jpg is with correct I2C wire connections,
Bottom section is when I removed a I2C wire.
Last edit: Haroen 2021-01-28
@Haroen
I think we will need an analysis of the I2C bus.
Did you buy a $7 analyser from Amazon?