Skip to content

Commit 4abdb77

Browse files
committed
Enabling PWM on pins A1/A2.
Pins A1/A2 uses TC4 to generate PWM, the same used in Servo library, so both cannot work together.
1 parent 80d212a commit 4abdb77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

variants/arduino_zero/variant.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ const PinDescription g_APinDescription[]=
139139
// 14..19 - Analog pins
140140
// --------------------
141141
{ PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[0]
142-
{ PORTB, 8, PIO_ANALOG, 0, ADC_Channel2, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_8 }, // ADC/AIN[2]
143-
{ PORTB, 9, PIO_ANALOG, 0, ADC_Channel3, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_9 }, // ADC/AIN[3]
142+
{ PORTB, 8, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel2, PWM4_CH0, TC4_CH0, EXTERNAL_INT_8 }, // ADC/AIN[2]
143+
{ PORTB, 9, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel3, PWM4_CH1, TC4_CH1, EXTERNAL_INT_9 }, // ADC/AIN[3]
144144
{ PORTA, 4, PIO_ANALOG, 0, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // ADC/AIN[4]
145145
{ PORTA, 5, PIO_ANALOG, 0, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // ADC/AIN[5]
146146
{ PORTB, 2, PIO_ANALOG, 0, ADC_Channel10, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[10]

0 commit comments

Comments
 (0)