Skip to content
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

ATmega328PB #78

Open
KHeintz opened this issue Apr 27, 2021 · 0 comments
Open

ATmega328PB #78

KHeintz opened this issue Apr 27, 2021 · 0 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@KHeintz
Copy link

KHeintz commented Apr 27, 2021

For the AVR I added the ATmega328PB. It has 3 16bit timers. Could address 22 servos. But I limited it to 20 servos, because I only need 20 servos . At TimerServos.h add I the 328PB

#elif defined(__AVR_ATmega328PB__) || defined(__AVR_ATmega128__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega2561__)
#define _useTimer3
#define _useTimer1
typedef enum { _timer3, _timer1, _Nbr_16timers } timer16_Sequence_t;

In servo.h define I the Atmega328PB with 10 servos on one timer.

#if defined(__AVR_ATmega328PB__)
#define SERVOS_PER_TIMER       10     // the maximum number 10 of servos controlled by one timer at the ATmega328PB
#else
#define SERVOS_PER_TIMER       12	 // the maximum number 12 of servos controlled by one timer
#endif

More than 11 servos on a timer makes no sense and everyone should ask themselves how many servos can be accommodated on a timer maximum because of the frame rate. 11 servos means already in the worst case 22ms or more frame rate or 45 Hz or less repetition rate.

@per1234 per1234 added the type: enhancement Proposed improvement label Apr 27, 2021
@per1234 per1234 added the topic: code Related to content of the project itself label Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants