Skip to content

Commit 8b33cff

Browse files
committed
Pin Mapping for GPIO BoosterPack
Adjust pin mapping for use with the GPIO Breakout BoosterPack
1 parent 44b53c1 commit 8b33cff

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

MQTB_Thrust_Stand/MQTB_Thrust_Stand.ino

+8-11
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
33
Pin connections for this software:
44
5-
PWM Output: Pin 14 or PB_6
6-
Current Sensor: Pin 29 or PE_2
7-
Voltage Sensor: Pin 28 or PE_3
8-
Load Cell Amp HX711.DOUT Pin 9 or PA_6
9-
HX711.PD_SCK Pin 8 or PA_5
10-
Electical/Magnetic RPMs Pin 31 or PF_4 or PUSH1
11-
Optical RPMs Pin 17 or PF_0 or PUSH2
5+
PWM Output: Pin 7,A5 or PB_4
6+
Voltage Sensor: Pin 27,AY or PE_1
7+
Current Sensor: Pin 28,AX or PE_2
8+
Load Cell Amp HX711.DOUT Pin 38,A6 or PB_3
9+
HX711.PD_SCK Pin 19,A7 or PB_2
10+
Electical/Magnetic RPMs Pin 31,A1 or PF_4 or PUSH1
11+
Optical RPMs Pin 17,B1 or PF_0 or PUSH2
1212
1313
Hardware PWM output adapted from: http://codeandlife.com/2012/10/30/stellaris-launchpad-pwm-tutorial/
1414
Stellaris timer code adapted from: http://patolin.com/blog/2014/06/29/stellaris-launchpad-energia-pt-2-timers/
@@ -71,6 +71,7 @@ void setup() {
7171
break;
7272
}
7373

74+
7475
scale.set_scale(LSCALE); // Eventually set this via EEPROM
7576
scale.tare(); // Reset the scale to 0
7677

@@ -149,7 +150,3 @@ void loop() {
149150
}
150151
delay(100);
151152
}
152-
153-
154-
155-

MQTB_Thrust_Stand/hardwareTimers.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ void adcTimer (unsigned Hz) {
77
ADCSequenceDisable(ADC0_BASE, 0);
88

99
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
1515
ADCSequenceStepConfigure(ADC0_BASE, 0, 5, ADC_CTL_CH1);
1616
ADCSequenceStepConfigure(ADC0_BASE, 0, 6, ADC_CTL_CH1);
1717
ADCSequenceStepConfigure(ADC0_BASE, 0, 7, ADC_CTL_CH1 | ADC_CTL_IE | ADC_CTL_END);
@@ -52,8 +52,8 @@ void initPWMOut () {
5252
SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0); //Enable control of PWM module 0
5353
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); //Enable control of GPIO B
5454

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
5757

5858
uint64_t PWMPeriod = (SysCtlClockGet () / ESCRATE);
5959
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() {
105105

106106
}
107107
}
108-

MQTB_Thrust_Stand/variables.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
// Scale Pins
3-
// HX711.DOUT - pin #9
4-
// HX711.PD_SCK - pin #8
5-
HX711 scale(9, 8);
6-
3+
// HX711.DOUT - pin #38
4+
// HX711.PD_SCK - pin #19
5+
HX711 scale(38, 19);
6+
77
// RPM input variables
88
volatile uint32_t stepCount1 = 0;
99
volatile uint32_t stepCount2 = 0;

0 commit comments

Comments
 (0)