RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#1 von buzz4stroke , 26.02.2021 17:37

Hello everyone,

I'm writing in English because my German grammar isn't at a level that I can start a thread at this MoBa forum.

I have a Arduino Nano + shield to control turnouts and/or signals. The function of this device is like the K83/84 decoders.
The understanding of programming the Arduino is on an OK level, and all the tutorials on YT are very helpful. Switching with buttons is no problem, I can control turnouts with coils and servo's (SG90 servo with a 3Dprinted adapter shaped like Marklin e-drive for Crail). And change the lights of signalposts.

But that is all analog driven by switches and buttons and in combination with and MS1. I've also a set 6021/6036/6040/6002. What fun would it be to control it with the 6040! and there is the giant leap for my knowledge.

The theoretical stuff i've read multiple times, have an optocoupler (6N137) working and been playing with different .ino files and libraries.
Links to them:
Laserlicht his library https://github.com/Laserlicht/MaerklinMotorola didn't use this no more
Laserlicht his library bugfixed by Mmame https://github.com/mmame/MaerklinMotorola
The Attiny85 decoder ino of Mmame https://github.com/Laserlicht/MaerklinMotorola

Taken different bumps in the road...... changing code Bits to Trits (?!?), Trouble compiling for Arduino Nano and even slimming down the (Mmame) code to the bare minimum for only reading and presenting the MM protocol to the serial monitor of the Arduino com port.
Sadly nothing works and the thing is driving me crazy, is someone willing to assist?

Answers in German in no problem, reading and speaking is something i can, writing is worse.

Wkr/Mfg Christiaan


Edit Wed 14. Apr 2021: Progress had been made, see post #13. Project had now it's own name: ARDIMO-wise!
The name ARDIMO is the acronym for AR(duino) DI(gital) MO(torola). the suffix wise refers to the wissels/seinen (dutch for turnouts and signals).


Trans Europ Express enthousiast/collector H0 and 1:1


 
buzz4stroke
Beiträge: 8
Registriert am: 23.02.2021
Spurweite H0
Stromart AC, Digital, Analog


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#2 von rmayergfx , 26.02.2021 19:01

Hello Christiaan,



Just a short question, why not using the existing library for MM/MM2 ? https://www.arduino.cc/reference/en/libr...erklinmotorola/

kind regards
Ralf


Der Computer soll die Arbeit des Menschen erleichtern und nicht umgekehrt!
Neue Kupplungen für Faller OHU Selbstentladewagen: viewtopic.php?f=27&t=82863
Kein Support per PN !


 
rmayergfx
ICE-Sprinter
Beiträge: 5.391
Registriert am: 07.07.2008
Gleise C-K-Flex-M-Gleis
Spurweite H0, Z, 1
Steuerung MS2, 6021, 60213
Stromart AC, Digital, Analog


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#3 von oliwel , 26.02.2021 20:24

Ralf, das ist die gleiche

Und auf meinem github Account gibt es eine Version die etwas aufgehübscht ist und für Anfänger ein paar Vereinfachungen enthält https://github.com/oliwel/MaerklinMotorola, den PR hat nur leider noch niemand angenommen

Oli


Spielbahner, Mä-Digital HO, 15qm Rahmenbau, Planungsphase, Rohbau, Graswurzel-Phase
Bautagebuch mit Bildern: http://www.oliwel.de/category/meine-modellbahn/
SBH und Blocksteuerung mit Bremsautomatik: viewtopic.php?f=7&t=187666


 
oliwel
InterCity (IC)
Beiträge: 891
Registriert am: 23.11.2014
Homepage: Link
Ort: Oberbayern
Gleise Mä K-Gleis
Spurweite H0
Steuerung CS3+, MobaLedLib, Selbstbau
Stromart Digital


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#4 von oliwel , 26.02.2021 20:34

Christian, you might want to try the GetTrits Example from my repo as there is a Bug in the original one.

A working example how to catch a command for a dedicated function adress can be Fonds in my BlockControl Project https://github.com/oliwel/MM2BlockContro...ontrol.ino#L201

I am not using an Optocoupler, just some resistors and power the arduino directly from the track power, a Layout is also in the repo.

Oliver


Spielbahner, Mä-Digital HO, 15qm Rahmenbau, Planungsphase, Rohbau, Graswurzel-Phase
Bautagebuch mit Bildern: http://www.oliwel.de/category/meine-modellbahn/
SBH und Blocksteuerung mit Bremsautomatik: viewtopic.php?f=7&t=187666


 
oliwel
InterCity (IC)
Beiträge: 891
Registriert am: 23.11.2014
Homepage: Link
Ort: Oberbayern
Gleise Mä K-Gleis
Spurweite H0
Steuerung CS3+, MobaLedLib, Selbstbau
Stromart Digital


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#5 von buzz4stroke , 26.02.2021 21:41

Thank you all for the comments, tips and guidance.
Will dive into it and post my progress here.


Trans Europ Express enthousiast/collector H0 and 1:1


 
buzz4stroke
Beiträge: 8
Registriert am: 23.02.2021
Spurweite H0
Stromart AC, Digital, Analog


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#6 von oliwel , 27.02.2021 08:41

Hi Chrisitaan,

just a sidenote in case you are not familiar with github - the changed code with the extended names is currently in the "develop" branch
https://github.com/oliwel/MaerklinMotoro...b5e84b357dcc70c

...and I would suggest to not use YT but the really good tutorials on the Arduino page

Oli


Spielbahner, Mä-Digital HO, 15qm Rahmenbau, Planungsphase, Rohbau, Graswurzel-Phase
Bautagebuch mit Bildern: http://www.oliwel.de/category/meine-modellbahn/
SBH und Blocksteuerung mit Bremsautomatik: viewtopic.php?f=7&t=187666


 
oliwel
InterCity (IC)
Beiträge: 891
Registriert am: 23.11.2014
Homepage: Link
Ort: Oberbayern
Gleise Mä K-Gleis
Spurweite H0
Steuerung CS3+, MobaLedLib, Selbstbau
Stromart Digital


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#7 von buzz4stroke , 27.02.2021 11:24

Oli,

Thank you very much, this morning loaded the GetBits.ino in the Nano and on the serial monitor the lines with code are appearing.
Github is new territory for me and i'm still learning every day, the revised code is something to remember to implement.
My goal is still to have a minimum set of code to accomplish the task, I'm not going to fire an elefantgun at a fly.

Wkr/Wfg Christiaan


Trans Europ Express enthousiast/collector H0 and 1:1


 
buzz4stroke
Beiträge: 8
Registriert am: 23.02.2021
Spurweite H0
Stromart AC, Digital, Analog


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#8 von buzz4stroke , 04.03.2021 00:32

Succes has been made!

The last days I have been tweaking the code for the universal K83/K84 decoder. Goal was to control some turnouts with servo's. Starting with some blinking leds you soon get the feeling and typing away. Sharing my code I hope that i can get some tips for the servo part as I still have twitching servo's when I select "decoder 4 red" and "decoder 5 green" (and vice versa).

Trying to generalise the code as lean as possible so I can use functions for multiple ports and different keys (red/green)

Code at GITHUB (see last post)


Trans Europ Express enthousiast/collector H0 and 1:1


atlebjanes hat sich bedankt!
 
buzz4stroke
Beiträge: 8
Registriert am: 23.02.2021
Spurweite H0
Stromart AC, Digital, Analog

zuletzt bearbeitet 13.08.2021 | Top

RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#9 von oliwel , 04.03.2021 19:59

Have a Look at MobaLedLib - yes the thread is huge but its worth it viewtopic.php?f=7&t=165060 - the "compressed" version is in the wiki https://wiki.mobaledlib.de/doku.php

They are building an Arduino based "Anything" decoder (but for the DCC protocol) but I guess you can leverage some of the servo control code and likely some hardware from the project.

Oli


Spielbahner, Mä-Digital HO, 15qm Rahmenbau, Planungsphase, Rohbau, Graswurzel-Phase
Bautagebuch mit Bildern: http://www.oliwel.de/category/meine-modellbahn/
SBH und Blocksteuerung mit Bremsautomatik: viewtopic.php?f=7&t=187666


 
oliwel
InterCity (IC)
Beiträge: 891
Registriert am: 23.11.2014
Homepage: Link
Ort: Oberbayern
Gleise Mä K-Gleis
Spurweite H0
Steuerung CS3+, MobaLedLib, Selbstbau
Stromart Digital


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#10 von mmame , 04.03.2021 21:19

I thought there was nobody else interested in decoding MM(2) on an Arduino so I stopped further development/bugfixes. Is there still help desired?


mmame  
mmame
S-Bahn (S)
Beiträge: 11
Registriert am: 13.08.2020


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#11 von oliwel , 05.03.2021 08:29

Zitat

I thought there was nobody else interested in decoding MM(2) on an Arduino so I stopped further development/bugfixes. Is there still help desired?



In case you have access to the Arduino Library I would appreciate if you can merge my changes into upstream, I already send Michael (Laserlight) an email but did not get any response.

Oliver


Spielbahner, Mä-Digital HO, 15qm Rahmenbau, Planungsphase, Rohbau, Graswurzel-Phase
Bautagebuch mit Bildern: http://www.oliwel.de/category/meine-modellbahn/
SBH und Blocksteuerung mit Bremsautomatik: viewtopic.php?f=7&t=187666


 
oliwel
InterCity (IC)
Beiträge: 891
Registriert am: 23.11.2014
Homepage: Link
Ort: Oberbayern
Gleise Mä K-Gleis
Spurweite H0
Steuerung CS3+, MobaLedLib, Selbstbau
Stromart Digital


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#12 von buzz4stroke , 05.03.2021 12:55

Zitat

I thought there was nobody else interested in decoding MM(2) on an Arduino so I stopped further development/bugfixes. Is there still help desired?



Please do! As my programming skills are really at a beginners level, but I am a quick learner.... The biggest challenge is the memory of turnouts and lighting, the 6040 holds the red/green position. In my code if power is off the memory is gone. You're code uses the EEPROM.h library, something I don't understand yet.
The summum would be if the integration of MM2 protocol in the MoBaLedLib code, but I think that's a bridge to far.
As Oliwel requested if you willing to implement the bug fixing in you're code I'll appreciate it. Probably the AtTiny85 sections are not useful for me but I'll respect you're mindset on that.


Trans Europ Express enthousiast/collector H0 and 1:1


 
buzz4stroke
Beiträge: 8
Registriert am: 23.02.2021
Spurweite H0
Stromart AC, Digital, Analog


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#13 von buzz4stroke , 14.04.2021 09:29

Hi all,

Last weekend I completed almost the revised code of the ARDIMO-wise. When it's done i'll post it here!
The name ARDIMO is the acronym for AR(duino) DI(gital) MO(torola). the suffix wise refers to the wissels/seinen (dutch for turnouts and signals).
Different operating modes are there to choose:
1. Turnout with coil
2. Turnout with servo
3. Signal with coil
4. Signal with servo
5. Signal with lights
6. Signal with lights fade
7. Lights on/off
8. Lights on/off fade
9. Lights blink
10. Decoupler rail


Trans Europ Express enthousiast/collector H0 and 1:1


 
buzz4stroke
Beiträge: 8
Registriert am: 23.02.2021
Spurweite H0
Stromart AC, Digital, Analog


RE: ARDIMO-wise: Arduino MM(2) protocol K83/84 decoder FREE TO DOWNLOAD!!

#14 von buzz4stroke , 22.04.2021 15:26

Hello everyone,

I just published version 1.0 of the ARDIMO-wise on GitHub. The code works and can be used for servos, coils and LEDs.
I have not written the manual yet, but for those who dare, you can try it independently (setup via the serial monitor of IDE).
Feel free to give feedback, timing of coil state could use some fine tuning I think.

Hereby the The download link to GitHub


Trans Europ Express enthousiast/collector H0 and 1:1


wvh hat sich bedankt!
 
buzz4stroke
Beiträge: 8
Registriert am: 23.02.2021
Spurweite H0
Stromart AC, Digital, Analog


   

Scarm ohne Gleisbibliotheken
Problem mit TC8/Tillig Schmalspur Weichen/Tillig Antrieb

  • Ähnliche Themen
    Antworten
    Zugriffe
    Letzter Beitrag
Xobor Einfach ein eigenes Forum erstellen
Datenschutz