This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: TM4C1294 Bit Bandig Single Bit Manipulation

Part Number: TM4C1294NCPDT

Tool/software:

Hello,

I am using TM4C1294 and I need to fast update at portF.
I initialize port  using lines below.

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
HWREG(GPIO_PORTF_BASE + GPIO_O_DIR) |= GPIO_PIN_1;
HWREG(GPIO_PORTF_BASE + GPIO_O_DEN) |= GPIO_PIN_1;

When I use following codes output of portF pin 1 changes.

HWREG(GPIO_PORTF_BASE + (GPIO_O_DATA + (GPIO_PIN_1 << 2))) = 0; and
HWREG(GPIO_PORTF_BASE+ (GPIO_O_DATA + (GPIO_PIN_1<< 2))) = GPIO_PIN_1;

However following codes did not work.  Could you specify my mistakes?
*((volatile uint32_t *) 0x421C4FF84) = 1;
*((volatile uint32_t *) 0x421C4FF84) = 0;

Best Regards

  • However following codes did not work.  Could you specify my mistakes?
    *((volatile uint32_t *) 0x421C4FF84) = 1;
    *((volatile uint32_t *) 0x421C4FF84) = 0;

    Why are you writing to 0x421C4FF84? The GPIOPinWrite() API already does the bit write. not read-modify-write. Why don't you look at the disassembly to see which address PF1 is mapped and written to. Also refer to the datasheet for bit write. See below. 

    PF1 is at address 0x4005D008. 

  • Dear Charles,
    Thanks for reply. I am looking for a fastest alternative to chage status of PF1. I think bit banding is faster than GPIOPinWrite(), so that is why I am looking for direct access to memory registers.
    Best Regards

  • As I mentioned, you should be writing to address 0x4005D008 with a value of 0x8 to set PF1 high.