Switches your modbus direction with the ch32v003
| Term | Definition |
|---|---|
| CC | Capture Channel |
| IC | Input Compare |
| OC | Output Compare |
| TIM | Timer |
| XCVR | Transciever |
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.
This project extensively utilizes TIM1 on the ch32v003.
This is the main branch.
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.
Feel free to leave a bug report or start development of your own branch.
Other forms of communication outside of github are acceptable.
- Initial Commit
- GPIO-driven version
- v0: Future release when microcontroller porting (to
J4M6) is complete
GNU GPL v3
(2026) Brandon Kirisaki
