From 4017f8fda20a9e3377cdebbedb22b13bc096d8d3 Mon Sep 17 00:00:00 2001 From: William Miceli Date: Fri, 25 Jun 2021 10:52:37 -0400 Subject: [PATCH] Fixed pin names for SD Card; added more comments to I/O init --- .../SunseekerTelemetry2021.h | 4 +- .../Debug_BlinkyLED-Advanced/io_init.c | 113 +++++++++--------- Telem_Debug/Debug_BlinkyLED-Basic/.project | 1 - .../org.eclipse.core.resources.prefs | 1 + .../SunseekerTelemetry2021.h | 4 +- .../Debug_UART-USB/SunseekerTelemetry2021.h | 4 +- Telem_Debug/Debug_UART-USB/io_init.c | 113 +++++++++--------- 7 files changed, 119 insertions(+), 121 deletions(-) diff --git a/Telem_Debug/Debug_BlinkyLED-Advanced/SunseekerTelemetry2021.h b/Telem_Debug/Debug_BlinkyLED-Advanced/SunseekerTelemetry2021.h index 806ae64..dd0b697 100644 --- a/Telem_Debug/Debug_BlinkyLED-Advanced/SunseekerTelemetry2021.h +++ b/Telem_Debug/Debug_BlinkyLED-Advanced/SunseekerTelemetry2021.h @@ -74,8 +74,8 @@ static inline void delay(void) // PORT 3 #define CAN0_SCLK 0x01 -#define SDC_SIMO 0x02 -#define SDC_SOMI 0x04 +#define SDC_MOSI 0x02 +#define SDC_MISO 0x04 #define SDC_SCLK 0x08 #define CAN0_MOSI 0x10 #define CAN0_MISO 0x20 diff --git a/Telem_Debug/Debug_BlinkyLED-Advanced/io_init.c b/Telem_Debug/Debug_BlinkyLED-Advanced/io_init.c index b3d69cf..48e4ad9 100644 --- a/Telem_Debug/Debug_BlinkyLED-Advanced/io_init.c +++ b/Telem_Debug/Debug_BlinkyLED-Advanced/io_init.c @@ -2,91 +2,90 @@ void io_init(void) { - /******************************PORT 1**************************************/ - P1OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P1DIR = P1_UNUSED; // Set to output - P1DIR &= ~(RTC_MFP | IMU_INTn); // Set to input + /****************************** PORT 1 **************************************/ + P1OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P1DIR = P1_UNUSED; // Set all unused pins to output + P1DIR &= ~(RTC_MFP | IMU_INTn); // Set specific pins to input /*Interrupts Enable*/ -// P1SEL = RTC_MFP | IMU_INTn; +// P1SEL = RTC_MFP | IMU_INTn; // Peripheral module function selected for specific pins // P1IE = RTC_MFP | IMU_INTn; // Enable Interrupts P1IES = IMU_INTn; // High to low P1IFG = 0x00; // Clear all interrupt flags on Port 1 delay(); - /******************************PORT 2**************************************/ - P2OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P2DIR = P2_UNUSED; // Set to output + /****************************** PORT 2 **************************************/ + P2OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P2DIR = P2_UNUSED; // Set all unused pins to output /*Interrupts Enable */ -// P2SEL = CAN0_INTn | CAN1_INTn | GPS_INTn; // Interrupts Select +// P2SEL = CAN0_INTn | CAN1_INTn | GPS_INTn; // Peripheral module function selected for specific pins // P2IES = CAN0_INTn | CAN1_INTn | GPS_INTn; // P2IE = CAN0_INTn | CAN1_INTn | GPS_INTn; // Enable Interrupts -// P2SEL |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // Interrupts Select +// P2SEL |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // Peripheral module function selected for specific pins // P2IES |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // P2IE |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // Enable Interrupts P2IFG = 0x00; // Clear all interrupt flags on Port 2 delay(); - /******************************PORT 3**************************************/ - P3OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P3DIR = CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_SIMO | CAN1_SCLK | P3_UNUSED; // Set to output - P3OUT |= CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_SIMO | CAN1_SCLK; // Pull used output pins high - P3DIR &= ~(CAN0_MISO | SDC_SOMI); - P3SEL = CAN0_SCLK | CAN0_MOSI | CAN0_MISO | SDC_SCLK | SDC_SIMO | SDC_SOMI | CAN1_SCLK | IMU_SDA; + /****************************** PORT 3 **************************************/ + P3OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P3DIR = CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_MOSI | CAN1_SCLK | P3_UNUSED; // Set to output + P3OUT |= CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_MOSI | CAN1_SCLK; // Pull used output pins high + P3DIR &= ~(CAN0_MISO | SDC_MISO); // Set specific pins to input + P3SEL = CAN0_SCLK | CAN0_MOSI | CAN0_MISO | SDC_SCLK | SDC_MOSI | SDC_MISO | CAN1_SCLK | IMU_SDA; - /******************************PORT 4**************************************/ - P4OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P4DIR = CAN0_RSTn | CAN0_CSn | CAN1_RSTn | CAN1_CSn | P4_UNUSED; // Set to output + /****************************** PORT 4 **************************************/ + P4OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P4DIR = CAN0_RSTn | CAN0_CSn | CAN1_RSTn | CAN1_CSn | P4_UNUSED; // Set specific pins to output P4OUT = CAN0_RSTn | CAN0_CSn | CAN1_RSTn | CAN1_CSn; // Pull used output pins high delay(); - P4OUT &= ~(CAN0_RSTn | CAN1_RSTn) ; + P4OUT &= ~(CAN0_RSTn | CAN1_RSTn); // Set specific pins of output register to low delay(); delay(); - P4OUT |= (CAN0_RSTn | CAN1_RSTn) ; + P4OUT |= (CAN0_RSTn | CAN1_RSTn); // Set specific pins of output register to high - /******************************PORT 5**************************************/ - P5OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P5DIR = XT2OUT | CAN1_MOSI | P5_UNUSED; - P5OUT = CAN1_MOSI; - P5DIR &= ~(CAN1_MISO); - P5SEL = XT2IN | XT2OUT | IMU_SCL | CAN1_MOSI | CAN1_MISO; + /****************************** PORT 5 **************************************/ + P5OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P5DIR = XT2OUT | CAN1_MOSI | P5_UNUSED; // Set specific pins to output + P5OUT = CAN1_MOSI; // Set specific pins of output register to high + P5DIR &= ~(CAN1_MISO); // Set specific pins to input + P5SEL = XT2IN | XT2OUT | IMU_SCL | CAN1_MOSI | CAN1_MISO; // Peripheral module function selected for specific pins - /******************************PORT 6**************************************/ - P6OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P6DIR = P6_UNUSED; - P6SEL = 0x00; + /****************************** PORT 6 **************************************/ + P6OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P6DIR = P6_UNUSED; // Set all unused pins to output + P6SEL = 0x00; // I/O function selected for all pins - /******************************PORT 7**************************************/ - P7OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P7DIR = XT1OUT | P7_UNUSED; - P7SEL = XT1IN | XT1OUT; + /****************************** PORT 7 **************************************/ + P7OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P7DIR = XT1OUT | P7_UNUSED; // Set specific pins to output + P7SEL = XT1IN | XT1OUT; // Peripheral module function selected for specific pins - /******************************PORT 8**************************************/ - P8OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P8DIR = LEDG | LEDR | LEDY0 | LEDY1 | P8_UNUSED; + /****************************** PORT 8 **************************************/ + P8OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P8DIR = LEDG | LEDR | LEDY0 | LEDY1 | P8_UNUSED; // Set specific pins to output P8DIR &= ~(Button0); // Set to input - P8SEL = 0x00; + P8SEL = 0x00; // I/O function selected for all pins - /******************************PORT 9**************************************/ - P9OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P9DIR = USB_TX | SDC_CSn | GPS_CSn | P9_UNUSED; - P9OUT = SDC_CSn | GPS_CSn; - P9SEL = RTC_SDA | RTC_SCL | USB_TX | USB_RX; + /****************************** PORT 9 **************************************/ + P9OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P9DIR = USB_TX | SDC_CSn | GPS_CSn | P9_UNUSED; // Set specific pins to output + P9OUT = SDC_CSn | GPS_CSn; // Set specific pins of output register to high + P9SEL = RTC_SDA | RTC_SCL | USB_TX | USB_RX; // Peripheral module function selected for specific pins - /******************************PORT 10**************************************/ - P10OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P10DIR = BT_CSn | BT_MOSI | BT_SCLK | UART_TX | BT_EN |P10_UNUSED; - P10OUT = BT_CSn | BT_MOSI | BT_SCLK; - P10SEL = BT_MOSI | BT_MISO | BT_SCLK | UART_TX | UART_RX; + /****************************** PORT 10 **************************************/ + P10OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P10DIR = BT_CSn | BT_MOSI | BT_SCLK | UART_TX | BT_EN |P10_UNUSED; // Set specific pins to output + P10OUT = BT_CSn | BT_MOSI | BT_SCLK; // Set specific pins of output register to high + P10SEL = BT_MOSI | BT_MISO | BT_SCLK | UART_TX | UART_RX; // Peripheral module function selected for specific pins + /****************************** PORT 11 **************************************/ + P11OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P11DIR = ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Set specific pins to output + P11OUT = ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Set specific pins of output register to high + P11SEL = ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Peripheral module function selected for specific pins - /******************************PORT 11**************************************/ - P11OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P11DIR = ACLK_TEST | MCLK_TEST | SMCLK_TEST; - P11OUT = ACLK_TEST | MCLK_TEST | SMCLK_TEST; - P11SEL = ACLK_TEST | MCLK_TEST | SMCLK_TEST; - - /******************************PORT J**************************************/ - PJOUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs + /****************************** PORT J **************************************/ + PJOUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs PJDIR = 0x0F; // Set to output as per user's guide } diff --git a/Telem_Debug/Debug_BlinkyLED-Basic/.project b/Telem_Debug/Debug_BlinkyLED-Basic/.project index b9240e0..141ffb6 100644 --- a/Telem_Debug/Debug_BlinkyLED-Basic/.project +++ b/Telem_Debug/Debug_BlinkyLED-Basic/.project @@ -7,7 +7,6 @@ org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, diff --git a/Telem_Debug/Debug_BlinkyLED-Basic/.settings/org.eclipse.core.resources.prefs b/Telem_Debug/Debug_BlinkyLED-Basic/.settings/org.eclipse.core.resources.prefs index 94d5cac..7c051cc 100644 --- a/Telem_Debug/Debug_BlinkyLED-Basic/.settings/org.eclipse.core.resources.prefs +++ b/Telem_Debug/Debug_BlinkyLED-Basic/.settings/org.eclipse.core.resources.prefs @@ -1,5 +1,6 @@ eclipse.preferences.version=1 encoding//Debug/makefile=UTF-8 +encoding//Debug/objects.mk=UTF-8 encoding//Debug/sources.mk=UTF-8 encoding//Debug/subdir_rules.mk=UTF-8 encoding//Debug/subdir_vars.mk=UTF-8 diff --git a/Telem_Debug/Debug_BlinkyLED-Basic/SunseekerTelemetry2021.h b/Telem_Debug/Debug_BlinkyLED-Basic/SunseekerTelemetry2021.h index 806ae64..dd0b697 100644 --- a/Telem_Debug/Debug_BlinkyLED-Basic/SunseekerTelemetry2021.h +++ b/Telem_Debug/Debug_BlinkyLED-Basic/SunseekerTelemetry2021.h @@ -74,8 +74,8 @@ static inline void delay(void) // PORT 3 #define CAN0_SCLK 0x01 -#define SDC_SIMO 0x02 -#define SDC_SOMI 0x04 +#define SDC_MOSI 0x02 +#define SDC_MISO 0x04 #define SDC_SCLK 0x08 #define CAN0_MOSI 0x10 #define CAN0_MISO 0x20 diff --git a/Telem_Debug/Debug_UART-USB/SunseekerTelemetry2021.h b/Telem_Debug/Debug_UART-USB/SunseekerTelemetry2021.h index e72aa5f..3fb6e61 100644 --- a/Telem_Debug/Debug_UART-USB/SunseekerTelemetry2021.h +++ b/Telem_Debug/Debug_UART-USB/SunseekerTelemetry2021.h @@ -81,8 +81,8 @@ static inline void delayMultiplied(int multiplier){ // PORT 3 #define CAN0_SCLK 0x01 -#define SDC_SIMO 0x02 -#define SDC_SOMI 0x04 +#define SDC_MOSI 0x02 +#define SDC_MISO 0x04 #define SDC_SCLK 0x08 #define CAN0_MOSI 0x10 #define CAN0_MISO 0x20 diff --git a/Telem_Debug/Debug_UART-USB/io_init.c b/Telem_Debug/Debug_UART-USB/io_init.c index b3d69cf..48e4ad9 100644 --- a/Telem_Debug/Debug_UART-USB/io_init.c +++ b/Telem_Debug/Debug_UART-USB/io_init.c @@ -2,91 +2,90 @@ void io_init(void) { - /******************************PORT 1**************************************/ - P1OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P1DIR = P1_UNUSED; // Set to output - P1DIR &= ~(RTC_MFP | IMU_INTn); // Set to input + /****************************** PORT 1 **************************************/ + P1OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P1DIR = P1_UNUSED; // Set all unused pins to output + P1DIR &= ~(RTC_MFP | IMU_INTn); // Set specific pins to input /*Interrupts Enable*/ -// P1SEL = RTC_MFP | IMU_INTn; +// P1SEL = RTC_MFP | IMU_INTn; // Peripheral module function selected for specific pins // P1IE = RTC_MFP | IMU_INTn; // Enable Interrupts P1IES = IMU_INTn; // High to low P1IFG = 0x00; // Clear all interrupt flags on Port 1 delay(); - /******************************PORT 2**************************************/ - P2OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P2DIR = P2_UNUSED; // Set to output + /****************************** PORT 2 **************************************/ + P2OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P2DIR = P2_UNUSED; // Set all unused pins to output /*Interrupts Enable */ -// P2SEL = CAN0_INTn | CAN1_INTn | GPS_INTn; // Interrupts Select +// P2SEL = CAN0_INTn | CAN1_INTn | GPS_INTn; // Peripheral module function selected for specific pins // P2IES = CAN0_INTn | CAN1_INTn | GPS_INTn; // P2IE = CAN0_INTn | CAN1_INTn | GPS_INTn; // Enable Interrupts -// P2SEL |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // Interrupts Select +// P2SEL |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // Peripheral module function selected for specific pins // P2IES |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // P2IE |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // Enable Interrupts P2IFG = 0x00; // Clear all interrupt flags on Port 2 delay(); - /******************************PORT 3**************************************/ - P3OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P3DIR = CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_SIMO | CAN1_SCLK | P3_UNUSED; // Set to output - P3OUT |= CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_SIMO | CAN1_SCLK; // Pull used output pins high - P3DIR &= ~(CAN0_MISO | SDC_SOMI); - P3SEL = CAN0_SCLK | CAN0_MOSI | CAN0_MISO | SDC_SCLK | SDC_SIMO | SDC_SOMI | CAN1_SCLK | IMU_SDA; + /****************************** PORT 3 **************************************/ + P3OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P3DIR = CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_MOSI | CAN1_SCLK | P3_UNUSED; // Set to output + P3OUT |= CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_MOSI | CAN1_SCLK; // Pull used output pins high + P3DIR &= ~(CAN0_MISO | SDC_MISO); // Set specific pins to input + P3SEL = CAN0_SCLK | CAN0_MOSI | CAN0_MISO | SDC_SCLK | SDC_MOSI | SDC_MISO | CAN1_SCLK | IMU_SDA; - /******************************PORT 4**************************************/ - P4OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P4DIR = CAN0_RSTn | CAN0_CSn | CAN1_RSTn | CAN1_CSn | P4_UNUSED; // Set to output + /****************************** PORT 4 **************************************/ + P4OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P4DIR = CAN0_RSTn | CAN0_CSn | CAN1_RSTn | CAN1_CSn | P4_UNUSED; // Set specific pins to output P4OUT = CAN0_RSTn | CAN0_CSn | CAN1_RSTn | CAN1_CSn; // Pull used output pins high delay(); - P4OUT &= ~(CAN0_RSTn | CAN1_RSTn) ; + P4OUT &= ~(CAN0_RSTn | CAN1_RSTn); // Set specific pins of output register to low delay(); delay(); - P4OUT |= (CAN0_RSTn | CAN1_RSTn) ; + P4OUT |= (CAN0_RSTn | CAN1_RSTn); // Set specific pins of output register to high - /******************************PORT 5**************************************/ - P5OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P5DIR = XT2OUT | CAN1_MOSI | P5_UNUSED; - P5OUT = CAN1_MOSI; - P5DIR &= ~(CAN1_MISO); - P5SEL = XT2IN | XT2OUT | IMU_SCL | CAN1_MOSI | CAN1_MISO; + /****************************** PORT 5 **************************************/ + P5OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P5DIR = XT2OUT | CAN1_MOSI | P5_UNUSED; // Set specific pins to output + P5OUT = CAN1_MOSI; // Set specific pins of output register to high + P5DIR &= ~(CAN1_MISO); // Set specific pins to input + P5SEL = XT2IN | XT2OUT | IMU_SCL | CAN1_MOSI | CAN1_MISO; // Peripheral module function selected for specific pins - /******************************PORT 6**************************************/ - P6OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P6DIR = P6_UNUSED; - P6SEL = 0x00; + /****************************** PORT 6 **************************************/ + P6OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P6DIR = P6_UNUSED; // Set all unused pins to output + P6SEL = 0x00; // I/O function selected for all pins - /******************************PORT 7**************************************/ - P7OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P7DIR = XT1OUT | P7_UNUSED; - P7SEL = XT1IN | XT1OUT; + /****************************** PORT 7 **************************************/ + P7OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P7DIR = XT1OUT | P7_UNUSED; // Set specific pins to output + P7SEL = XT1IN | XT1OUT; // Peripheral module function selected for specific pins - /******************************PORT 8**************************************/ - P8OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P8DIR = LEDG | LEDR | LEDY0 | LEDY1 | P8_UNUSED; + /****************************** PORT 8 **************************************/ + P8OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P8DIR = LEDG | LEDR | LEDY0 | LEDY1 | P8_UNUSED; // Set specific pins to output P8DIR &= ~(Button0); // Set to input - P8SEL = 0x00; + P8SEL = 0x00; // I/O function selected for all pins - /******************************PORT 9**************************************/ - P9OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P9DIR = USB_TX | SDC_CSn | GPS_CSn | P9_UNUSED; - P9OUT = SDC_CSn | GPS_CSn; - P9SEL = RTC_SDA | RTC_SCL | USB_TX | USB_RX; + /****************************** PORT 9 **************************************/ + P9OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P9DIR = USB_TX | SDC_CSn | GPS_CSn | P9_UNUSED; // Set specific pins to output + P9OUT = SDC_CSn | GPS_CSn; // Set specific pins of output register to high + P9SEL = RTC_SDA | RTC_SCL | USB_TX | USB_RX; // Peripheral module function selected for specific pins - /******************************PORT 10**************************************/ - P10OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P10DIR = BT_CSn | BT_MOSI | BT_SCLK | UART_TX | BT_EN |P10_UNUSED; - P10OUT = BT_CSn | BT_MOSI | BT_SCLK; - P10SEL = BT_MOSI | BT_MISO | BT_SCLK | UART_TX | UART_RX; + /****************************** PORT 10 **************************************/ + P10OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P10DIR = BT_CSn | BT_MOSI | BT_SCLK | UART_TX | BT_EN |P10_UNUSED; // Set specific pins to output + P10OUT = BT_CSn | BT_MOSI | BT_SCLK; // Set specific pins of output register to high + P10SEL = BT_MOSI | BT_MISO | BT_SCLK | UART_TX | UART_RX; // Peripheral module function selected for specific pins + /****************************** PORT 11 **************************************/ + P11OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs + P11DIR = ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Set specific pins to output + P11OUT = ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Set specific pins of output register to high + P11SEL = ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Peripheral module function selected for specific pins - /******************************PORT 11**************************************/ - P11OUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs - P11DIR = ACLK_TEST | MCLK_TEST | SMCLK_TEST; - P11OUT = ACLK_TEST | MCLK_TEST | SMCLK_TEST; - P11SEL = ACLK_TEST | MCLK_TEST | SMCLK_TEST; - - /******************************PORT J**************************************/ - PJOUT = 0x00; // Pull pins low, only affects ports set as output, no effect on inputs + /****************************** PORT J **************************************/ + PJOUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs PJDIR = 0x0F; // Set to output as per user's guide }