Skip to content
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

Opposite DTR and RTS state. #10

Closed
dequn opened this issue Nov 13, 2018 · 4 comments
Closed

Opposite DTR and RTS state. #10

dequn opened this issue Nov 13, 2018 · 4 comments

Comments

@dequn
Copy link

dequn commented Nov 13, 2018

According to the code, you may just set the opposite of DTR and RTS, I debug a full day for it, even through I doubt it's maybe my laptop system's bug or the driver bug.

 def dtrChanged(self):
        if self.checkBoxDtr.isChecked():
            self.com.setDTR(False)
        else:
            self.com.setDTR(True)

# so does rtsChanged
@Neutree
Copy link
Owner

Neutree commented Nov 13, 2018

maybe setDTR means set DTR to low level output or not
so setDTR(True) makes low level output
setDTR(False) makes high level output

doc here

@dequn
Copy link
Author

dequn commented Nov 14, 2018

Hello, I looked up some basic knowledge about serial communication, mostly is about RS-232 standard. DTE(Date Terminal Equipment, our computer reference) asserts DTR (Data Terminal Read) when it is ready to receive data, so RTS(Request to send) also. When these two box checked, it stand for we can receive data, but if has been set the opposite value background, We can't read data from serial conn anymore. I think we don't need think about the high/low level, just send a logic value and pySerial do it for us.

Actually, I tried to jump into pySerial source code, but as the first time to do hardware work, it's a little hard for me to understand absolutely. Hope for your explanation, Thank you!

RS-232

@Neutree
Copy link
Owner

Neutree commented Nov 15, 2018

that's right, these two checkbox of this software(comtool) means set DTR/RTS to high level or not, but not set to valid or not.
And i didnt consider hadware flowcontrol in my early work, I can change the meaning of DTR/RTS checkbox to the same as pyserial do later.

@Neutree
Copy link
Owner

Neutree commented Dec 7, 2021

I added hardware flow control, and it controlled by pyserial

and when you want to control it by hand, the RTS DTR item now turn on means enable, not mean pin level anymore

@Neutree Neutree closed this as completed Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants