Hello,
I've used the search function to go through similar threads about this. It seems to come up recently, but I can't find my source of error. I'm attempting to modify the bootloader program (bootload_serial) for the TM4C123G microcontroller. During the UART setup in ConfigureDevice() within bl_main.c, I want to configure a pair of transceiver pins (A2 and A3).
I'm aware that A2 and A3 are NMI pins that need to be unlocked. I'm able to modify my DEN and DIR register just fine. I'm also aware of the bit-masking/addressing required to write to the GPIODATA. I attempt to write to the pins, but when I view the register, it doesn't appear like anything was written. Am I missing something?
Thanks.
HWREG(GPIO_PORTA_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTA_BASE + GPIO_O_CR) |= ((1 << 2) | (1 << 3));
HWREG(GPIO_PORTA_BASE + GPIO_O_AFSEL) &= ~((1 << 3) | (1 << 2)); // Select A2 and A3 to function as GPIOs
HWREG(GPIO_PORTA_BASE + GPIO_O_DEN) |= (1 << 3); //Enable digital functions on DXEN
HWREG(GPIO_PORTA_BASE + GPIO_O_DEN) |= (1 << 2); //Enable digital functions on RXEN
HWREG(GPIO_PORTA_BASE + GPIO_O_DIR) |= (1 << 3); //Set DXEN as output
HWREG(GPIO_PORTA_BASE + GPIO_O_DIR) |= (1 << 2); //Set RXEN as output
HWREG(GPIO_PORTA_BASE + GPIO_O_DR4R) |= (1 << 3); //DXEN
HWREG(GPIO_PORTA_BASE + GPIO_O_DR4R) |= (1 << 2); //RXEN
HWREG(GPIO_PORTA_BASE + GPIO_O_LOCK) = 0;
HWREG(GPIO_PORTA_BASE + (GPIO_O_DATA + (0x8 << 2))) = 1; //DXEN active high
HWREG(GPIO_PORTA_BASE + (GPIO_O_DATA + (0x4 << 2))) = 0; //RXEN active low