Input Programming

Hey, I'm a newbie around.

I'm currently using a STR912FW44 32 Bit Microcontroller von ST Microelectronics, on a Keil MBSTR9 board. I'm programming the device with Keil 3.05 and I ve encountered some troubles in writing a program which should read the state of the two push buttons on the board (connected to 2 of the pins of port 3) and transfer the read hex value on port 7 (which can be visualized with LEDS on the board).

I've tried everything, it just won't work. No errors. Just doesn't turn the LEDS on...If someone has already dealed with this little thingie, I'll be more than glad to hear your opinions.

Here is my program:

#include <91x_lib.h>
#include <stdio.h>

int main (void)
{
unsigned short Wert;

/*port 3 input on pins 5,6*/
SCU->GPIOOUT[3] &= 0xC3FF;
GPIO3->DDR &= 0x9F;

/*port7 output mode on all the pins*/
SCU->GPIOOUT[7] = 0x5555;
GPIO7->DDR = 0xFF;

/*transfer value*/

while (1)
{
Wert = GPIO3 -> DR[0x180];
GPIO7 -> DR[0x3FC] = Wert;
}
}
[1185 byte] By [ellaroxana] at [2007-11-20 7:10:34]