Skip to content

MAGLaboratory/modbus-autodir

Repository files navigation

Modbus-Autodirection

Switches your modbus direction with the ch32v003

Schematic depicting the expected usage of this automatic direction switching module

Acronyms, Abbreviations, and Definitions

Term Definition
CC Capture Channel
IC Input Compare
OC Output Compare
TIM Timer
XCVR Transciever

Project Description

This is an automatic direction switcher for RS485 / Modbus applications. Its main goal is to provide automatic direction switching in systems where dedicating a direction switching pin is difficult or impossible.

It does this by switching the direction pin on an RS485 transciever based on the baud rate detected from the previous message.

Hardware Description

This project extensively utilizes TIM1 on the ch32v003.

Branch Description

This is the main branch.

Deployment

Remember to double-check the flags between the two common ch32v003 chips: F4P6 and J4M6. J4M6 is the end-use chip while F4P6 was used for development.

Development and builds are done using MounRiver Studio. A project file is provided. Unfortunately, the open source toolchains do not provide support for hardware interrupt prologue / epilogue.

Help

Feel free to leave a bug report or start development of your own branch.

Other forms of communication outside of github are acceptable.

Version History

  • Initial Commit
    • GPIO-driven version
  • v0: Future release when microcontroller porting (to J4M6) is complete

License

GNU GPL v3

Authors

(2026) Brandon Kirisaki

About

automatic direction switcher for modbus transciever

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages