I am trying to put some value on FD[0..15] by PORT B and PORT D. Th FD[0..7] is connected to LEDs on Spartan board.But I am having problem a these values are not shown up. The code on kiel is compiling fine and can upload the firmware onto EZ USB FX2 without any problem but th desired values are not displayed. BTW, i use vhdl code to make reset fo board. Here is my code:
#define ALLOCATE_EXTERN #include #include
void init_fx2(void); void init_gpif(void);
void init_fx2(void) { CPUCS = 0x10; // Sets CPU to 48MHz clock EP1INCS = EP1INCS & (0xff - bmEPSTALL); // Resetting the STALL bit i case it was set so the USB-Host EP1OUTCS = EP1OUTCS & (0xff - bmEPSTALL); // doesn't get an erro message for trying to read EP1OUTBC = 0x40; // Writing to EP1OUTBC rearms for an ou transfer }
void init_gpif(void) { IFCONFIG = 0xCE; // 48 MHz,internal clock, and master GPIF OEB = 0xFF; // Configure as output port OED = 0xFF; // Configure as output port }
void main(void) { init_fx2(); init_gpif(); while (1){ // Forever do: IOB = 0xAA; // For blinking of LEDs IOD = 0xAA; // For blinking of LEDs } }
Anticipating in advance. Muhammad Imran The Netherlands