Hi ,
I am new to programming to embedded c. Just I have written a program to glow red LED in TM4C123 launch pad.
The programme has no errors and flash downloaded in my kit. But the RED LED is not glow now. Just let me know
any error in this code.
#include <stdint.h>
#include "tm4c123gh6pm.h"
int main(void)
{
volatile uint32_t *gpiof_data=(uint32_t *)GPIO_PORTF_DATA_R;
void PortF_Init();
*gpiof_data = 0x02;
}
void PortF_Init(void)
{
volatile unsigned long delay;
SYSCTL_RCGC2_R |= 0x00000020; // 0b0010 0000
delay = SYSCTL_RCGC2_R;
GPIO_PORTF_LOCK_R = 0x4C4F434B;
GPIO_PORTF_CR_R = 0x1F; // 0b0001 1111
GPIO_PORTF_AMSEL_R = 0x00; //0b0000 0000 disable analaog mode
GPIO_PORTF_PCTL_R = 0x00000000;
GPIO_PORTF_DIR_R = 0x0E; // PF0,PF4 input PF1-PF3 output
GPIO_PORTF_AFSEL_R = 0x00;// disable alternate function
GPIO_PORTF_PUR_R = 0x11;
GPIO_PORTF_DEN_R = 0x1F;
}
Thanks & Regards,
P.RAJKUMAR