Another beginners question
Hi, I'm new to modern microcontrollers, but the LM3S1968 evaluation board has been an excellent way of 'catching-up'. I have mastered the interupt handling and am generally making good progress, but have hit a very simple obstacle that I can't climb.
I decided to convert the blinky application from direct hardware control to using the Peripheral Driver Library. Here is the code, but the LED doesn't blink - can someone tell me what I'm missing, because I can't see it?
| Code: |
//*****************************************************************************
//
// Blink the on-board LED.
//
//*****************************************************************************
#include "lm3s1968.h"
#include "hw_gpio.h"
#include "hw_ints.h"
#include "hw_memmap.h"
#include "hw_types.h"
#include "debug.h"
#include "gpio.h"
#include "interrupt.h"
#include "sysctl.h"
int
main(void)
{
volatile unsigned long ulLoop;
// unsigned long Counter;
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
GPIODirModeSet(GPIO_PORTG_BASE, GPIO_PIN_2, GPIO_DIR_MODE_OUT);
while(1)
{
GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_2, 0xff);
for(ulLoop = 0; ulLoop < 200000; ulLoop++)
{
}
GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_2, 0x00);
for(ulLoop = 0; ulLoop < 200000; ulLoop++)
{
}
}
}
|
Any comments welcome, because I'm also brushing-up on C after a 20-year absence,
Thanks in advance,
Valgamaa.
login or register to reply
|