Part Number: TM4C123GH6PM
Hy,
I have bought Tiva C Series TM4C123G LaunchPad Evaluation Kit and i am very satisfied, works very well.
I have implemented some code from the youtube tutorials, something like this :
#include <lm4f120h5qr.h>
int main()
{
int counter = 0;
// General Purpose Input/Output Run Mode Clock Gating Control (RCGCGPIO)
*((unsigned int*)0x400FE608) = 0x20;
// The RGB leds are connected to PF1, PF2, PF3
// GPIO Direction - GPIODIR
*((unsigned int*)0x40025400) = 0x0E;
// GPIO Digital Enable - GPIODEN
*((unsigned int*)0x4002551C) = 0x0E;
while(1)
{
// GPIO Data - GPIODATA - Red led ON
*((unsigned int*)0x400253FC) = 0x02;
counter = 0;
while(counter < 1000000)
{
counter++;
}
// GPIO Data - GPIODATA - Blue led ON
*((unsigned int*)0x400253FC) = 0x04;
counter = 0;
while(counter < 1000000)
{
counter++;
}
// GPIO Data - GPIODATA - Green led ON
*((unsigned int*)0x400253FC) = 0x08;
counter = 0;
while(counter < 1000000)
{
counter++;
}
}
return 0;
}
This code works very well, but my problem is why, when i want to access GPIODATA the address is 0x400253FC.
In the datasheet of microcontroller the address of GPIODATA is 0x40025000.
I understand that this controller has six modules (A,B,C,D,E and F) but i cant I can not figure out how to calculate the address above ?
Thank you.