demogorgi / set-rtc-using-dcf77-via-dcf1

Micropython script to set real-time clock (rtc) using DCF77 receiver module DCF1
9 stars 3 forks source link

Module with inverted logic #2

Closed varna9000 closed 3 years ago

varna9000 commented 3 years ago

Hi, I've got a dcf77 module with inverted logic output. I tried to invert output Pin values like so v = not dcfpin.value() and feed the data into the library but it always fails the parity check. Any idea what else need to be changed to get your library work with inverted bits module?

demogorgi commented 3 years ago

Hi, "not ..." yields a boolean. Try abs(dcfpin.value()-1) probably? It is also important that you have a good signal strength. Test your setup outside if possible. Best regards and good luck.

On Sun, Jun 27, 2021, 11:14 varna9000 @.***> wrote:

Hi, I've got a dcf77 module with inverted logic output. I tried to invert output Pin values like so v = not dcfpin.value() and feed the data into the library but it always fails the parity check. Any idea what else need to be changed can I get your library to work with inverted bits module?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/demogorgi/set-rtc-using-dcf77-via-dcf1/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZOFGXW474IIMYQUFHIC2LTU3TW5ANCNFSM47MGXKQQ .

varna9000 commented 3 years ago

I removed your comments in some part of the code to print the receiving bits. It looks like "not" operator reverses them, but will try your suggestion as well. On a second note, I tried some Arduino libraries with my module and it looks the signal is quite noisy. I'm around 1600 km from signal source and I suspect there is quite interference on the way to me, so I might not be lucky to get this working.