2018-10-02 10:54 AM
Hi Guys i am trying to get the data from lidar which works on UART and i am using interrupt to get the data value but i am not getting the acc to datasheet of lidar i am using HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size); function to fill my buffer here is the datasheet screen shots
and yes i am using 115200 baud rate.
2018-10-02 10:56 AM
2018-10-02 11:11 AM
Should just post the data sheet link? https://www.robotshop.com/media/files/pdf2/rb-ben-03_2017-11-23-benewake-tfmini-micro-lidar-module-ip65-12-m-datasheet.pdf
and perhaps the data you see on the oscilloscope vs in memory? You know, the stuff that's material to your observation/assertion, and not on the wider internet already.
Different how? If you poll a byte at a time do you see the expected data form?
Using what STM32, board, etc?
2018-10-02 11:23 AM
Also the datasheet is outdated this is what i got from oscilloscopeso instead of getting 0x59 i am getting 0x9A and i am using NUCLEO-64.
2018-10-02 11:28 AM
Ok, so a pair of 0x59 bytes, no perceivable inter-symbol gap beyond the start/stop bits. Do you have coverage of the complete frame?
Computer receives what?
2018-10-02 11:49 AM
well i am not able to get full waveform so i reduced time scale
and this is what i am getting from buffer
2018-10-02 11:56 AM
0x59 = bit reversed 0x9a. Check your USART settings for MSB/LSB first.
2018-10-02 12:40 PM
You want the buffer as bytes not 16-bit words, you'd need words if you were using a 9-bit mode, but you shouldn't be here.
0x5959 is 22873
@Bob S standard UART serial is LSB first, don't think it is an option to do it anyway else on the STM32.
The first scope trace is START(0) 10011010 STOP(1), twice
2018-10-02 01:18 PM
At least on 32L4xx, there is a MSBFIRST bit in USARTx_CR2. Unless I missed it (possible), Divesh doesn't say WHICH Nucleo-64 so I don't know exactly which CPU he is using.
But I think you found the issue w/16-bit data. The sample data he posted shows 2 packets if you unwind the 16-bit data into bytes.
2018-10-03 07:13 AM
Hey guys i am using Nucleo-f303