This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

28335 led toggle example, how to run?

Hello, we have f28335 and I am assigned to learn how to program it with DSP. I tried the Lab1 of  Frank Bormann PDF file but the LEDs did not change, do they have to change or there is some way of determining if the program is successfully loaded to card?

 

I have setup my openSuSE laptop with CCSv5 and the connection between the card and the laptop seems to be OK since I can debug the program.

 

Sorry if the question is stupid but I am not familiar with this type of development although I am a computer programmer.

 

 

Forgot to put the code I tried from that PDF.

extern void InitSysCtrl(void);


#include "DSP28x_Project.h"

void main(void)
{
    InitSysCtrl();

    EALLOW;
    GpioCtrlRegs.GPADIR.bit.GPIO31 = 1;
    GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1;
    EDIS;

    GpioDataRegs.GPACLEAR.bit.GPIO31 = 1;
    GpioDataRegs.GPBSET.bit.GPIO34 = 1;

    int i;
    while(1)
    {
        GpioDataRegs.GPATOGGLE.bit.GPIO31 = 1; // toggle LD2
        GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1; // toggle LD3
        for (i=0; i<1000000; i++)
        {
            ;
        }           // time delay
    }
}

 

Why there is no code tag when posting.

  • If you read my description carfully, it says that you have to define a long datatype for variable i. However, in your code snipped(its not my original, I would never define a variable in the middle of a function) you declared an "int i", which is 16 bit. This way, the for loop will never hit 100000 - your LEDs will never toggle.

    So change your variable from int to long and please define it at the beginning of main.