aikopras / AP_DCC_library

Arduino library for (NMRA) Digital Command Control (DCC) messages. Primarily intended for accessory and function Decoders. Based on OpenDecoder 2 software. Source code includes many comments.
GNU General Public License v3.0
10 stars 4 forks source link

Library used with DFR0282 ATmega32u4 ? #5

Open gorillale opened 2 months ago

gorillale commented 2 months ago

Hi, Thanks you for this libray, i used with Nano, Mega and Due. I will use a beetle DFR0282 ATmega32u4 looks like as a Leonardo. Is this libray compatible with this?

regards andy

aikopras commented 2 months ago

Thanks for your question. I just tried to compile the library using the Leonardo board, but got (as expected) an error. The problem with the 32u4 is that it has only a single 8bit timer. This timer is already used by the Arduino millis() function. Sorry, Aiko

gorillale commented 2 months ago

Thank you for your help, it's a shame that the small beetle doesn't work. Attiny85 seems to have the same problem, timer2 is missing as far as I can see.

I'll try the beetle with NMRA, I think it works without a timer, and I don't need to read it via CV. The problem there could be Railcom, I still have to test it.

Regards

trimarco232 commented 1 month ago

"it's a shame that the small beetle doesn't work." Hi @gorillale , sorry for the late reply you should be able to make it work with a classic AVR , by using one input capture pin for the timer 1 to do this , one have to modify the file sup_isr_Mega.h in the AP_DCC library , are you interested ?

gorillale commented 1 month ago

Sie sollten es mit einem klassischen AVR zum Laufen bringen können, indem Sie einen Eingangserfassungspin für Timer 1 verwenden. Dazu müssen Sie die Datei sup_isr_Mega.h in der AP_DCC-Bibliothek ändern. Sind Sie interessiert?

Hi Thanks for the message. I have now used NMRA_Dcc because I need a timer in the software myself. And it worked without much trying. I have now programmed NMRA_Dcc so that I can also set CVs in POM mode (reading them out is not possible due to the slow CPU). I use BiDiB/iTrain and second DCC-EX as test station. Regards Andrew

trimarco232 commented 1 month ago

ok , nice setup !