i have problem to check my output result....(isn't i write something wrong?)..Below is the code that i wrote....Anyone can guide me?
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "inc/hw_nvic.h"
#include "inc/hw_ints.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/timer.h"
unsigned long timer;
int
main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
GPIOPinTypeGPIOOutput (GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
SysCtlDelay(200);
//GPIO config
GPIOPinConfigure(GPIO_PB7_T0CCP1);
GPIOPinTypeTimer(GPIO_PORTB_BASE, GPIO_PIN_7);
//Timer config
TimerConfigure(TIMER0_BASE, TIMER_CFG_A_CAP_COUNT_UP);
TimerControlEvent(TIMER0_BASE, TIMER_B, TIMER_EVENT_POS_EDGE);
TimerLoadSet(TIMER0_BASE, TIMER_A, SysCtlClockGet()/10);//8000000/10=80000=100 milliseconds
TimerEnable(TIMER0_BASE, TIMER_A);
while(1)
{
timer = TimerValueGet(TIMER0_BASE,TIMER_A);
if(timer==0)
{
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_2, 0x00);
}
else
{
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_2, 0x04);
}
}
}