@@ -7,11 +7,11 @@ void adcTimer (unsigned Hz) {
7
7
ADCSequenceDisable (ADC0_BASE, 0 );
8
8
9
9
ADCSequenceConfigure (ADC0_BASE, 0 , ADC_TRIGGER_PROCESSOR, 3 );
10
- ADCSequenceStepConfigure (ADC0_BASE, 0 , 0 , ADC_CTL_CH0);
11
- ADCSequenceStepConfigure (ADC0_BASE, 0 , 1 , ADC_CTL_CH0 );
12
- ADCSequenceStepConfigure (ADC0_BASE, 0 , 2 , ADC_CTL_CH0 );
13
- ADCSequenceStepConfigure (ADC0_BASE, 0 , 3 , ADC_CTL_CH0 );
14
- ADCSequenceStepConfigure (ADC0_BASE, 0 , 4 , ADC_CTL_CH1);
10
+ ADCSequenceStepConfigure (ADC0_BASE, 0 , 0 , ADC_CTL_CH2); // CH2 = PE_1
11
+ ADCSequenceStepConfigure (ADC0_BASE, 0 , 1 , ADC_CTL_CH2 );
12
+ ADCSequenceStepConfigure (ADC0_BASE, 0 , 2 , ADC_CTL_CH2 );
13
+ ADCSequenceStepConfigure (ADC0_BASE, 0 , 3 , ADC_CTL_CH2 );
14
+ ADCSequenceStepConfigure (ADC0_BASE, 0 , 4 , ADC_CTL_CH1); // CH1 = PE_2
15
15
ADCSequenceStepConfigure (ADC0_BASE, 0 , 5 , ADC_CTL_CH1);
16
16
ADCSequenceStepConfigure (ADC0_BASE, 0 , 6 , ADC_CTL_CH1);
17
17
ADCSequenceStepConfigure (ADC0_BASE, 0 , 7 , ADC_CTL_CH1 | ADC_CTL_IE | ADC_CTL_END);
@@ -52,8 +52,8 @@ void initPWMOut () {
52
52
SysCtlPeripheralEnable (SYSCTL_PERIPH_PWM0); // Enable control of PWM module 0
53
53
SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOB); // Enable control of GPIO B
54
54
55
- GPIOPinConfigure (GPIO_PB6_M0PWM0 ); // Map PB6 to PWM0 G0, OP 0
56
- GPIOPinTypePWM (GPIO_PORTB_BASE, GPIO_PIN_6 ); // Configure PB6 as PWM
55
+ GPIOPinConfigure (GPIO_PB4_M0PWM2 ); // Map PB6 to PWM0 G0, OP 0
56
+ GPIOPinTypePWM (GPIO_PORTB_BASE, GPIO_PIN_4 ); // Configure PB4 as PWM
57
57
58
58
uint64_t PWMPeriod = (SysCtlClockGet () / ESCRATE);
59
59
PWMGenConfigure (PWM0_BASE, PWM_GEN_0, PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_NO_SYNC); // Configure PWM0 G0 as UP/DOWN counter with no sync of updates
@@ -105,4 +105,3 @@ void rpmTimer() {
105
105
106
106
}
107
107
}
108
-
0 commit comments