fiendie / Funkuhr

An Arduino library for decoding DCF77 signals
GNU General Public License v2.0
13 stars 7 forks source link

Support for atmega4809 #5

Open keiwanjamaly opened 9 months ago

keiwanjamaly commented 9 months ago

Hi there,

When I tried to get your Library working, I was confronted with this error compiling:

/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp: In member function 'void Funkuhr::init()':
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:112:2: error: 'TCCR2B' was not declared in this scope
  TCCR2B |= (1<<CS22);
  ^~~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:112:2: note: suggested alternative: 'TCB2'
  TCCR2B |= (1<<CS22);
  ^~~~~~
  TCB2
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:112:16: error: 'CS22' was not declared in this scope
  TCCR2B |= (1<<CS22);
                ^~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:115:18: error: 'CS21' was not declared in this scope
  TCCR2B &= ~((1<<CS21) | (1<<CS20));
                  ^~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:115:30: error: 'CS20' was not declared in this scope
  TCCR2B &= ~((1<<CS21) | (1<<CS20));
                              ^~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:118:2: error: 'TCCR2A' was not declared in this scope
  TCCR2A &= ~((1<<WGM21) | (1<<WGM20));
  ^~~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:118:2: note: suggested alternative: 'TCB2'
  TCCR2A &= ~((1<<WGM21) | (1<<WGM20));
  ^~~~~~
  TCB2
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:118:18: error: 'WGM21' was not declared in this scope
  TCCR2A &= ~((1<<WGM21) | (1<<WGM20));
                  ^~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:118:31: error: 'WGM20' was not declared in this scope
  TCCR2A &= ~((1<<WGM21) | (1<<WGM20));
                               ^~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:121:17: error: 'WGM22' was not declared in this scope
  TCCR2B &= ~(1<<WGM22);
                 ^~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:124:2: error: 'ASSR' was not declared in this scope
  ASSR |= (0<<AS2);
  ^~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:124:2: note: suggested alternative: 'SS'
  ASSR |= (0<<AS2);
  ^~~~
  SS
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:124:14: error: 'AS2' was not declared in this scope
  ASSR |= (0<<AS2);
              ^~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:124:14: note: suggested alternative: 'A2'
  ASSR |= (0<<AS2);
              ^~~
              A2
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:127:2: error: 'TIMSK2' was not declared in this scope
  TIMSK2 |= (1<<TOIE2) | (0<<OCIE2A);
  ^~~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:127:2: note: suggested alternative: 'TIMERB2'
  TIMSK2 |= (1<<TOIE2) | (0<<OCIE2A);
  ^~~~~~
  TIMERB2
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:127:16: error: 'TOIE2' was not declared in this scope
  TIMSK2 |= (1<<TOIE2) | (0<<OCIE2A);
                ^~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:127:29: error: 'OCIE2A' was not declared in this scope
  TIMSK2 |= (1<<TOIE2) | (0<<OCIE2A);
                             ^~~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:35:22: error: 'TCNT2' was not declared in this scope
 #define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT
                      ^
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:128:2: note: in expansion of macro 'RESET_TIMER2'
  RESET_TIMER2;
  ^~~~~~~~~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:35:22: note: suggested alternative: 'TCB2'
 #define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT
                      ^
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:128:2: note: in expansion of macro 'RESET_TIMER2'
  RESET_TIMER2;
  ^~~~~~~~~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp: In function 'void TIMER2_OVF_vect()':
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:35:22: error: 'TCNT2' was not declared in this scope
 #define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT
                      ^
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:238:2: note: in expansion of macro 'RESET_TIMER2'
  RESET_TIMER2;
  ^~~~~~~~~~~~
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:35:22: note: suggested alternative: 'TCB2'
 #define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT
                      ^
/Users/bomel/Documents/Arduino/libraries/Funkuhr-master/Funkuhr.cpp:238:2: note: in expansion of macro 'RESET_TIMER2'
  RESET_TIMER2;
  ^~~~~~~~~~~~

exit status 1

Compilation error: exit status 1

It appears that these registers do not exist on the atmega4809. Do you plan to include support for the atmega4809? Otherwise, I'm considering decoding the DCF77 signal by myself.

fiendie commented 9 months ago

Hey!

To be perfectly honest, I wasn't even aware of that MCU before today. The Timer architecture seems to be quite different and I don't have a board to test it with. Plus, I don't really have that much spare time to invest into it. I would of course gladly accept Pull Requests if you (or anyone else for that matter) manages to get it running :)

Regards Andy

keiwanjamaly commented 9 months ago

Hei there,

I built something on my own. I think it differs from yours, that I can perform tasks around the off interval, risking a miss of it. When I understand it correctly, your Library ensures, that the whole signal is processed isolated and nothing gets missed. These are two different ways of solving a problem, but in my use case, I prefer to stick to my implementation. But if you are interested in it, I always like productive discussions xD

Best Keiwan