cancel
Showing results for 
Search instead for 
Did you mean: 

Printing Garbage Value

Divesh Dutt
Associate II

Hi there,

I am working with tfmini lidar and i am using USART3.However i am getting the garbage in the virtual port any idea how can i resolve this but i am getting the right header i.e YY in decimal.

Any suggestion would be appreciated.

Thanks

0693W00000AMIO5QAP.png

14 REPLIES 14
Divesh Dutt
Associate II

Hi John,

The sensor talk to stm using I2C? I Connected sensor as per datasheet using UART protocol using rx and tx lines.Do you mean to say it is something internally that changes it to i2c?The code i wrote is extremely simple.Getting data in interrupt mode,Raising a flag in callback function and use this flag in while loop0693W00000AMuw5QAD.png

raptorhal2
Lead

TeslaDelorean is correct. Read the data sheet for this device.

Each 8 byte data frame starts with a 0x5959 which happens to be ascii YY, but the remaining bytes are binary. Either convert the binary to ascii before sending to Tera Term, or use a terminal emulator that provides for a hex display that is easier to interpret than garbage.

The literature says the comm is USART/I2C. USART seems to be the default.

Cheers, Hal

Divesh Dutt
Associate II

Oh ok what you saying is tera term doesn't support the binary number.I didn't know that.i'll try another emulator or will convert it to hex.

John E KVAM
ST Employee

What is the part number of the sensor you are using?


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
John E KVAM
ST Employee

After much conversation, this is not an ST part. It's from Sparkfun, but based on an LED emitter and photo diode.


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.