Home arrow Support arrow Forums

Luminary Micro Forums

valgamaa

Fresh Boarder

2008/05/12 15:55

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_BASEGPIO_PIN_2GPIO_DIR_MODE_OUT);      while(1)          {          GPIOPinWrite(GPIO_PORTG_BASEGPIO_PIN_20xff);         for(ulLoop 0ulLoop 200000ulLoop++)             {             }         GPIOPinWrite(GPIO_PORTG_BASEGPIO_PIN_20x00);         for(ulLoop 0ulLoop 200000ulLoop++)             {             }         } }



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

      Topics Author Date
    thread link
Another beginners question
valgamaa 2008/05/12 15:55
    thread link
thread linkthread link Re:Another beginners question
cb1 2008/05/13 09:41
    thread link
thread linkthread linkthread link Re:Another beginners question
valgamaa 2008/05/13 14:01