8000 New proposal for improved approach to handle MCU reset with RTS and DTR sequence · Issue #824 · cncjs/cncjs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

New proposal for improved approach to handle MCU reset with RTS and DTR sequence #824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cheton opened this issue Mar 31, 2023 · 0 comments

Comments

@cheton
Copy link
Collaborator
cheton commented Mar 31, 2023

See #813 (review)

MitchBradley

The code seems solid but I think there is a better approach. Some MCUs, including ESP32, require a pulse on RTS with DTR held in a particular state. To handle this, I propose a string whose characters define a sequence of states:

d means DTR low
D means DTR high
r means RTS low
R means RTS high
nnn (a decimal number) means delay that many milliseconds
optional spaces for readability
An ESP32 reset would thus be "Dr50R". The existing cases could be handled with, for example, "", "d", "D", "r", "R", "dR", etc. There would only need to be one variable that could handle all situations. It could even handle delay-after-open with just a number, like "1000" for wait one second before proceeding.

A little more refinement:

empty string means "perform the controller-specific default reset sequence"
"0" means "do nothing, overriding the controller's default sequence". It is equivalent to "delay 0 milliseconds", so does not require a special case in the parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0