Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: MSP432 eUSCI_B3 confusion

$
0
0
I was having some difficulty getting the I2C on P6 to work on our board, so I decided to eliminate some variables and use a MSP-TS432PZ100 development board. I parameterized my code to work with any of the UCBx peripherals, and tried each one in turn with an external I2C device module. My code worked fine with every one (UCB0, UCB1, UCB2, and UCB3 (on P10). But it wouldn't work on UCB3 on P6. The lines both stayed high the whole time (which is what I saw on our board). I tried several times and double checked my connections and code. Any Ideas why there might be issues with the UCB3 I2C peripheral on P6.6 an P6.7 not responding on two different boards? The relevant portion of my code is below from my I2C Init() function. I pass in the EUSCI base address to select a different peripheral. I have to uncomment for UCB3 depending on if I want top use P6 or P10. The base address passed in m_uart is the only thing I change. if (EUSCI_B0_BASE == m_uart) // UCB0xxx { m_uart_interrupt = INT_EUSCIB0; MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION); // SLAS826E pg. 139 Table 6-62 } else if (EUSCI_B1_BASE == m_uart) // UCB1xxx { m_uart_interrupt = INT_EUSCIB1; MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P6, GPIO_PIN4 | GPIO_PIN5, GPIO_PRIMARY_MODULE_FUNCTION); // SLAS826E pg. 139 Table 6-63 } else if (EUSCI_B2_BASE == m_uart) // PM_UCB2xxx { m_uart_interrupt = INT_EUSCIB2; MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3, GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION); // SLAS826E pg. 143 Table 6-64 } else if (EUSCI_B3_BASE == m_uart) // UCBxxx { m_uart_interrupt = INT_EUSCIB3; MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P6, GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION); // SLAS826E pg. 162 Table 6-66 //MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P10, GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION); // SLAS826E pg. 145 Table 6-65 } I have an ISR function that is parameterized by the base address as well, so they are all identical: void EUSCIB0_IRQHandler(void) { I2C_Isr(EUSCI_B0_BASE); } void EUSCIB1_IRQHandler(void) { I2C_Isr(EUSCI_B1_BASE); } void EUSCIB2_IRQHandler(void) { I2C_Isr(EUSCI_B2_BASE); } void EUSCIB3_IRQHandler(void) { I2C_Isr(EUSCI_B3_BASE); }

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>