This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

help about write data RS232
#1
Hello,  I'm starting to work with logic machine, I've been connecting the logic machine to a pc through the rs232 port,  I could write from the logic machine to a pc terminal, but result is wrong with string I wrote.
P/S: I conect LM5 Re:actor with PC by Board USB to USART.
Thank you.
Reply
#2
Check baud rate, stop bits and parity settings. Defaults for serial library are 115200, 1 stop bit, no parity.
Reply
#3
(29.03.2018, 09:34)admin Wrote: Check baud rate, stop bits and parity settings. Defaults for serial library are 115200, 1 stop bit, no parity.

Thank you for your replay!
I checked, I use : Baud rate 115200, 1 stop bit, no parity.
I wrote string 'gh', Result: '  L'.
Thanks you.
My code in Resident:

if not port then
  require('serial')
  port = serial.open('/dev/RS232', { baudrate =115200 })
  port:flush()
  line = ''
end
port:write('gh')
Reply
#4
Are you sure you have USB-RS232 adapter? You might have USB-UART (TTL) which can be easily damaged if connected to RS-232 port.
Reply
#5
(29.03.2018, 10:36)admin Wrote: Are you sure you have USB-RS232 adapter? You might have USB-UART (TTL) which can be easily damaged if connected to RS-232 port.

I use board USB to USART (chip CP2102- TTL) and use board STM32F4 discovery communicate by USART, both result same.
Thanks for help.
Reply


Forum Jump: