Home arrow Support arrow Forums

Luminary Micro Forums

fv78

Fresh Boarder
Click here to see the profile of this user

2007/02/01 01:20

buffer initialization

Hi,
I can't seem to make the piece of code below running.
The user LED on the EVLM3S811 never lights on!
What am I doing wrong ?
The problem is located in the for loop which seems to
work if I decrease the buffer's size to say 200.

thanks in advance for your help

PS: memset(buf, 'A', sizeof(buf)) doesn't work either.


#include "hw_types.h"
#include "hw_memmap.h"
#include "sysctl.h"
#include "gpio.h"

int main(void)
{
int buf[512];
int i;

// Set the clocking to run at 20MHz from the PLL
SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ);

// Enable the peripherals used by the application
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
// Configure LED, push button
GPIODirModeSet(GPIO_PORTC_BASE, GPIO_PIN_5, GPIO_DIR_MODE_OUT);
GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_5, 0);

for(i=0; i<310; i++) buf[i] = 0x0;
i = buf[0]; // to avoid warning in this example
GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_5, GPIO_PIN_5);

while(1);

}

Post edited by: fv78, at: 2007/02/01 01:22

login or register to reply

      Topics Author Date
    thread link
buffer initialization
fv78 2007/02/01 01:20
    thread link
thread linkthread link Re:buffer initialization
orinem 2007/02/01 02:20
    thread link
thread linkthread linkthread link Re:buffer initialization
fv78 2007/02/01 02:44