TG9541 / stm8ef-modbus

A lightweight framework for MODBUS RTU nodes in STM8 eForth that can do more than just I/O
https://github.com/TG9541/stm8ef/wiki/Board-C0135
MIT License
31 stars 12 forks source link

Problems with uploading modbus files on STM8S103F3 board. #41

Closed szymonk159 closed 2 years ago

szymonk159 commented 2 years ago

I am trying to do similar project like STM8S001JRS485 with modbus but using STM8S103F3 board and I can't upload modbus files on my board. I already downloaded on my board MINDEV.ihx using stm8flash but when I am uploading files in terminal some errors appear. 251473754_301563005126267_2181958665072965252_n And this is my hardware: 254693199_279210360636572_1720134847936959929_n Do you have any ideas how can I fix this ? Thank you very much in advance.

TG9541 commented 2 years ago

@szymonk159 you're trying to upload the Forth program through an RS485 dongle - unfortunately that won't work: the Forth console would have to switch your RS485 transceiver to "RX" in order to receive anything from the PC that runs e4thcom (it can be done, I guess, but depending on the type of RS485 transceiver it requires hacking the Forth kernel).

For a console I'd like to recommend using a simple two-wire serial interface with any of the following binaries:

szymonk159 commented 2 years ago

Thanks for answer. So I need to buy and use 2-wire serial interface (for example PL2303) to use terminal and upload modbus files on my board and then I can use RS485 and TTL-UART converter to communicate with computer by modbus?

TG9541 commented 2 years ago

Yes, a standard PL2303 or CH340 USB-RS232 dongles does the trick. As indicated in the sketch here a diode turns the dongle's TxD into a "open collector" output (the STM8S port pin pulls the level up).

Other possible sources for a USB serial converter are certain old interface cables for mobile phones. It's also possible to hack the USB-RS485 dongle so that it can be used as a serial interface. If you'd like to give it a try, the schematics of one of the ubiquitous black-green adapters is here.

TG9541 commented 2 years ago

@szymonk159 I'll close this issue for now - please reopen if you have more questions.