Question about timers July 30, 2022 01:53AM |
Registered: 8 months ago Posts: 11 |
Re: Question about timers July 30, 2022 02:37AM |
Admin Registered: 12 years ago Posts: 6,729 |
Re: Question about timers July 30, 2022 12:21PM |
Registered: 8 months ago Posts: 11 |
Quote
Dust
I think timer 3 and 5 is unused
Quote
Dust
servo uses timer 4
Re: Question about timers August 06, 2022 02:39AM |
Registered: 8 months ago Posts: 11 |
Re: Question about timers August 06, 2022 06:41AM |
Registered: 6 years ago Posts: 290 |
TIMER3B 2 TIMER3C 3 TIMER0B 4 TIMER3A 5 TIMER4A 6 TIMER4B 7 TIMER4C 8 TIMER2B 9 TIMER2A 10 TIMER1A 11 TIMER1B 12 TIMER0A 13 TIMER5C 44 TIMER5B 45 TIMER5A 46
Re: Question about timers August 06, 2022 11:07AM |
Registered: 8 months ago Posts: 11 |
Quote
[email protected]
- Heater pins and soft PWM fan pins use the digital output function only. They can be assigned to any pin. The temperature timer is used to implement the soft PWM for these pins.
Re: Question about timers August 06, 2022 11:29AM |
Registered: 8 months ago Posts: 11 |
/** * (8-bit AVRs only) * * get_pwm_timer * Grabs timer information and registers of the provided pin * returns Timer struct containing this information * Used by set_pwm_frequency, set_pwm_duty * * set_pwm_frequency * Sets the frequency of the timer corresponding to the provided pin * as close as possible to the provided desired frequency. Internally * calculates the required waveform generation mode, prescaler and * resolution values required and sets the timer registers accordingly. * NOTE that the frequency is applied to all pins on the timer (Ex OC3A, OC3B and OC3after @Dust's answer on another topic (which I made in the general section as I wasn't sure it's possible to achive through marlin), I was able to find this bit of code in "temperature.h" which I think means the selection of timer for "Fan Fast PWM" depends on which pins are defined for fans but I'm not sure how it'll handle multiple fans if that's the case* NOTE that there are limitations, particularly if using TIMER2. (see Configuration_adv.h -> FAST FAN PWM Settings) */ #if ENABLED(FAST_PWM_FAN) static void setPwmFrequency(const pin_t pin, int val); typedef struct Timer { volatile uint8_t* TCCRnQ[3]; // max 3 TCCR registers per timer volatile uint16_t* OCRnQ[3]; // max 3 OCR registers per timer volatile uint16_t* ICRn; // max 1 ICR register per timer uint8_t n; // the timer number [0->5] uint8_t q; // the timer output [0->2] (A->C) } Timer; static Timer get_pwm_timer(const pin_t pin); static void set_pwm_frequency(const pin_t pin, int f_desired); #endif static void set_current_temp_raw();
Re: Question about timers August 06, 2022 12:51PM |
Registered: 6 years ago Posts: 290 |
Re: Question about timers August 06, 2022 03:01PM |
Registered: 8 months ago Posts: 11 |