-
Notifications
You must be signed in to change notification settings - Fork 1
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
Decoder sends messages too fast #2
Comments
Probably the problem is in "micros()" function. |
Thanks for your quick response! |
It is possible that the Arduino UNO is not fast enough for similar clocks, have you tried with a higher performing Arduino such as Arduino Due or UNO R4? |
Same here with an Arduino Uno and a Piko Sound Decoder XP 5.1. I Receive 2-5 correct message and Afterwards only crap. :( Changeing line 63 hast no effect. @FancyRedCat what Lines did you change for shifting and toggling? Thx. |
Sorry, I don't have a higher performing Arduino, maybe I can test with a Pi pico later. @adcStefanAdam I didn't change any other lines except line 63. So it is still not working. I had no time for more tests in the last week. |
Hi again, you wrote:
so where did you do that? BTW. the Piko Decoder Haus an Option for Alterung the clock rate in CV 120. the value of the CV is Multiplied with 1 Micro Second and Summer up with 10 Micro Seconds. So I tried a value of 87 which makes 97 Micro seconds and a value of 184 which makes 194 Micro seconds to get the values shown for your Zimo Decoder. But still with no luck. greetings. |
Hi @adcStefanAdam, tldr: I did the bit shifting manually without programming. I used the serial debug output. I knew from my Zimo how it should look "right". So I multiplied the debug values manually by 2 and compared them with the RCN-600 spec. Btw I also looked at a Kuehn N45, this decoder has a variable clock speed. But I forgot to take a screenshot. The shortest ticks were 10µs+10µs, the longer were around 20µs or 30µs. But all whitin the spec. I don't own a Piko decoder so I cannot test this with my setup. Your values sounds good. Do you have a oscilliscope or a logic analyzer to check if the decoder sends valid messages? But I don't think this is a problem because Piko ships many locos with susi modules onboard. Greetings |
Hi again, no i haven’t got a Logic analyzer. Which one do you usw or prefer? Greetings. |
After buying and using a digital oscilloscope it seems that the Piko Decoder is putting down the CLK signal after some messages on the SUSI bus and then starting the whole process again. So is there an ACK message of the slave decoder missing? So the master is thinking the slave is gone and then is trying to communicate again? |
Hi,
I have found your great lib and have done some tests by myself. With my Zimo decoder (MX685) it works great. Then I switched to a Doehler & Haass DH18A and the same Arduino UNO cannot decode the SUSI-messages.
I loaded the PrintRawMessage-Sketch and expanded it with a hex output. The Zimo decoder produces correct results but the D&H the following:
The recived messages look like crap. But when I shift the messages 1 bit left and toggle the last bit they will become "readable":
After further investigation, I think I found a clue: D&H Decoders use a faster clock speed then Zimo. Both are within the SUSI-specification (chapter 4):
Zimo
t_on ~ 76-115µs
D&H
t_on ~ 10-11µs
Do you have an idea how to speed up your lib? I would like to use the internal RC oscillator @ 8MHz because I want to save space on my pcb ;)
And I like the DH18A because they are smaller then the Next18 decoders from ESU and Zimo.
Kind regards
The text was updated successfully, but these errors were encountered: