Hi. I got a TOF10120 laser range finder from a mention on picaxe forum and looked interesting so got one.
Data sheet is mostly Chinese.
out put is
Gnd
VDD
RX
TX
SDA
SCL
I tried a uno and can't program with device tx connected to uno rx and device rx connected uno tx.
Disconnected tx and rx and it flashes code.
Then reconnect tx to rx and rx to tx and should get 5 bytes repeating
,,, but I messed up. Is it the usb port to terminal is same input port as range finder.
Any advice would be helpful. cheers.
;TOF10120 Laser Range Sensor Module serial to terminal
#chipmega328p, 16
#defineUSART_BAUD_RATE9600
#defineUSART_TX_BLOCKINGdimrangefinder(5)doHSerReceiverangefinder(1)HSerReceiverangefinder(2)HSerReceiverangefinder(3)HSerReceiverangefinder(4)HSerReceiverangefinder(5)HSerPrintStringCRLFrangefinder(1)HSerPrintStringCRLFrangefinder(2)HSerPrintStringCRLFrangefinder(3)HSerPrintStringCRLFrangefinder(4)HSerPrintStringCRLFrangefinder(5)HserPrintCRLFloop
The tof10120 has serial so I tried for lgt but same as 328 nano
'USART settings for USART1
#defineUSART_BAUD_RATE9600
#defineUSART_BLOCKING; #define USART_DELAY OFF
#defineSerInPortPORTd.0'USART 1 Rx PinDimMyStringasString'GLCD selected extension font set. ASCII characters 31-254, the extended font uses 1358 bytes of program memory
#defineGLCD_EXTENDEDFONTSET1GLCDfntDefaultsize=3GLCDRotate(Landscape)' optionally you can rotate the screen.doHSerGetStringMyStringGLCDPrint(2, 2,MyString+"",ILI9341_WHITE); wait 1 sloop
this after a minute prints 2000mm
and that's all it does.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I2C. The I2C interface is unstable and locked to a single address.
Using the i2C Terminal from Microchip I can discover a device on 0xF4 some of the time, but mostly I get fails. The I2C bus frequency has no bearing on the failure to respond.
Using the i2C Terminal from Microchip I tried to change the I2C address using function s7. The sensor accepted the command... but, did nothing.
If you look at the attachment - you will see the same command work, fail, fail, work, scan fail.... something is not right.....
Serial Interface - 9600BPS
Use the terminal I tried to change the I2C address using "s7-168" - "fail"
All commands to set the device respond with "fail"
All command to read the device... no response.
I know I have valid communications as I get "fail"... there is something there... but, I do not think it is a sensor that works.
And, there is something odd about the sensor. When attaching there is a current surge that causes a USB reset, and, the sensor is warm.
Operating at 3v3 or 5v0 make no difference.
Summary - looks like a TOF10120, but, is not. This is a 3aq20 microcontroller .. but there probably no real sensor attached.
Nice one Evan.
I thought it was duff or something.
Thanks for the help, appreciated.
so I can finally give up on this device or get another.
the vl0x worked better. nicest I've used.
going back to HC-SR04....using 3 and hbridge stuff...yawn
but know it works
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anobium. I got your emails and it was like I posted "by the time you figure the device, you find it's duff and too late to send back"
oh well, live and learn :) , cheers for testing though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well I'm not as optimistic as you but think if a device is faulty...like loads off fleabay,
then you can demand your money back AND THEY PAY THE POSTAGE on the grounds that it was sold as working.
So don't bother with the returner pays postage. They'll send you a return postage free pdf,
if you can be bothered over a few £ device,
but if it cost say £7.50...like this device, then contact the retailer and moan.
They do not want their ebay rating to go down.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Anobium-"Yes, a real pain. I buy and test straight away... I have so many failures.. I sort of expect it."
Pessimistic but reality. If it's not "plug n play working" out the package optimistic fools like me think it's me doing something wrong :) wiser :)
What would be a fast enough glcd for LGT328 using touch please?
Showing thickness but why not hwspi for ili9341 and software for the touch pins...
like tclk not connected to clock?
Sorry if a daft question.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You may be able to turn off the hardware SPI, then use software SPI for Touch. My guess is that is that the UNO never came across this issue.. as it 50% slower.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And there lies the rub. ili9341 drawing graphics fast with LGT328 but the touch is not hwspi so the speed advantages on creating boxes and checking them is lost ,,well drawing boxes with software spi is slow but the rest, like checking them would be 2x faster than mega328.
it's an odd situation. the speed increase on ili glcd is so noticeable with lgt328 seems a shame to have to slow it down,
the mega328 works display and touch hwspi fine. ili9341 include is brill.
a lgt328 is not going to make my toy robots any better but someone else
make a case for a 32mhz 328 ie twice as fast....and is it the fastest mcu supported by gcb?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Speed of each program step/increment?
Speed of comms bus like serial. i2c, spi
Speed to move a block of RAM ?
Well Speed to move a block of RAM ?
copying one array to another and Speed of each program step/increment
seem visually faster but isn't spi speed set up in the program?
I thought pics do an instruction every 4 clocks but mega328 does instruction every clock so a pic18fxxx, 64 would be same as a mega328,16.
Any pics that run at18fxxx,128 or is my assumption wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi. I got a TOF10120 laser range finder from a mention on picaxe forum and looked interesting so got one.
Data sheet is mostly Chinese.
out put is
Gnd
VDD
RX
TX
SDA
SCL
I tried a uno and can't program with device tx connected to uno rx and device rx connected uno tx.
Disconnected tx and rx and it flashes code.
Then reconnect tx to rx and rx to tx and should get 5 bytes repeating
,,, but I messed up. Is it the usb port to terminal is same input port as range finder.
Any advice would be helpful. cheers.
Last edit: stan cartwright 2020-12-07
The tof10120 has serial so I tried for lgt but same as 328 nano
this after a minute prints 2000mm
and that's all it does.
My analysis of the TOF10120 sensor Stan sent me.
Summary: It is clone that does not work.
I2C. The I2C interface is unstable and locked to a single address.
Using the i2C Terminal from Microchip I can discover a device on 0xF4 some of the time, but mostly I get fails. The I2C bus frequency has no bearing on the failure to respond.
Using the i2C Terminal from Microchip I tried to change the I2C address using function s7. The sensor accepted the command... but, did nothing.
If you look at the attachment - you will see the same command work, fail, fail, work, scan fail.... something is not right.....
Serial Interface - 9600BPS
Use the terminal I tried to change the I2C address using "s7-168" - "fail"
All commands to set the device respond with "fail"
All command to read the device... no response.
I know I have valid communications as I get "fail"... there is something there... but, I do not think it is a sensor that works.
And, there is something odd about the sensor. When attaching there is a current surge that causes a USB reset, and, the sensor is warm.
Operating at 3v3 or 5v0 make no difference.
Summary - looks like a TOF10120, but, is not. This is a 3aq20 microcontroller .. but there probably no real sensor attached.
Last edit: Anobium 2021-02-03
Nice one Evan.
I thought it was duff or something.
Thanks for the help, appreciated.
so I can finally give up on this device or get another.
the vl0x worked better. nicest I've used.
going back to HC-SR04....using 3 and hbridge stuff...yawn
but know it works
Anobium. I got your emails and it was like I posted "by the time you figure the device, you find it's duff and too late to send back"
oh well, live and learn :) , cheers for testing though.
Pleasure. It is as-if the microcontroller ( the 3aq20 ) as enough code to respond to the I2C discovery, but, nothing else in terms of functionality.
I could knock up a chip that has a bit of I2C... we could set a few million a few bucks each... and...then live off the money!
Well I'm not as optimistic as you but think if a device is faulty...like loads off fleabay,
then you can demand your money back AND THEY PAY THE POSTAGE on the grounds that it was sold as working.
So don't bother with the returner pays postage. They'll send you a return postage free pdf,
if you can be bothered over a few £ device,
but if it cost say £7.50...like this device, then contact the retailer and moan.
They do not want their ebay rating to go down.
Yes, a real pain. I buy and test straight away... I have so many failures.. I sort of expect it.
The device. if ok., looked interesting with serial asc out and i2c.
I'll stick with working/sorted rangefinders.... I only use them for toy robots.
@Anobium-"Yes, a real pain. I buy and test straight away... I have so many failures.. I sort of expect it."
Pessimistic but reality. If it's not "plug n play working" out the package optimistic fools like me think it's me doing something wrong :) wiser :)
What would be a fast enough glcd for LGT328 using touch please?
Showing thickness but why not hwspi for ili9341 and software for the touch pins...
like tclk not connected to clock?
Sorry if a daft question.
You may be able to turn off the hardware SPI, then use software SPI for Touch. My guess is that is that the UNO never came across this issue.. as it 50% slower.
And there lies the rub. ili9341 drawing graphics fast with LGT328 but the touch is not hwspi so the speed advantages on creating boxes and checking them is lost ,,well drawing boxes with software spi is slow but the rest, like checking them would be 2x faster than mega328.
it's an odd situation. the speed increase on ili glcd is so noticeable with lgt328 seems a shame to have to slow it down,
the mega328 works display and touch hwspi fine. ili9341 include is brill.
a lgt328 is not going to make my toy robots any better but someone else
make a case for a 32mhz 328 ie twice as fast....and is it the fastest mcu supported by gcb?
Fast.. you need to define fast.
Fast.. you need to define fast.
Speed of each program step/increment?
Speed of comms bus like serial. i2c, spi
Speed to move a block of RAM ?
Well Speed to move a block of RAM ?
copying one array to another and Speed of each program step/increment
seem visually faster but isn't spi speed set up in the program?
I thought pics do an instruction every 4 clocks but mega328 does instruction every clock so a pic18fxxx, 64 would be same as a mega328,16.
Any pics that run at18fxxx,128 or is my assumption wrong?