Reply
Visitor
Posts: 7
Registered: ‎09-07-2014
Accepted Solution

Can not control LEDs

Hi.

I'm writing a very basic LEDs setting program for the Spartan-6 LX150T kit running MicroBlaze. The program is:

#include <stdio.h>

#include "platform.h"

#include "xparameters.h"

#include <xgpio.h>

int main()

{

   XGpio led; // LED declaration

 

   XGpio_Initialize(&led, XPAR_LEDS_DEVICE_ID);

   XGpio_SetDataDirection(&led,0,0);

   XGpio_DiscreteWrite(&led,0,0x55);

 

   return 0;

}

 

My UCF file indicates that all pins are correctly tied to the LEDs in the kit. Also the program is being correctly downloaded to the board and I can see from the console messages that it's reacting to the RESET buttom. Just the LEDs don't react.

Any hint?

Thanks

Joao

Avnet Employee (Star Contributor)
Posts: 511
Registered: ‎05-05-2009

Re: Can not control LEDs

Your code looks OK. Would you post your UCF and MHS files?

Visitor
Posts: 7
Registered: ‎09-07-2014

Re: Can not control LEDs

Hi.

I have just found out that I was using the Xgpio_SetDatadirection function in an unpropper way.

Sorry for taking your time.

Best regards

João