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

[question] Data timing #33

Open
robertklep opened this issue May 17, 2021 · 3 comments
Open

[question] Data timing #33

robertklep opened this issue May 17, 2021 · 3 comments

Comments

@robertklep
Copy link

Hi!

I was reading through the library code, trying to comprehend the timing it applies, specifically the usage of 750μs here and here.

If I understand the code and the OpenTherm specification correctly, shouldn't that be 650μs (500μs nominal plus an additional 150μs for the maximum transition period)?

image

Also, strictly speaking, shouldn't a timeout occur after 1150μs instead of 1000μs as it does now?

Reason I'm asking is because I'm trying to track down some issues with invalid messages being received from my thermostat. I'll try and see if changing the timing fixes them, but just wondering if I understand the code correctly 😊

@ihormelnyk
Copy link
Owner

750μs - 500μs+250μs - to check 1->0, 0->1 bit transition
1000μs timeout is ok, because there should be interrupt every half bit (500μs)

@robertklep
Copy link
Author

@ihormelnyk thanks!

I still don't understand where the 250μs is coming from. I assume it's based on the 100+150μs transition period, but from how I understand the specification, the 100μs is how much shorter than 500μs a transition may be. So a valid half bit period is 400μs to 650μs, isn't that right?

@IgorYbema
Copy link

So I was looking at it also just to understand it.
750ms is just the half bit time (500ms) plus another 250ms (quarter of the bit time). This allows it to sync with the mid-bit transistions (synced at the first start bit) and ignore the begin-of-bit transitions (if machester encoding requires a transitions at begin of the bit). As you state, half bits are in between 400 and 650ms. So another transistion (triggered by the interrupt gpio change input) with is at least 750ms must always be the transition for the mid-bit point (counted from the first start bit).
So the code essentiantly ignores the begin-of-bit transitions and only read the mid-bit transitions.

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

3 participants