AnsweredAssumed Answered

GPIO general question

Question asked by Greg Hartl on May 8, 2010
Latest reply on May 10, 2010 by Greg Hartl

Hi Freescale Community,


I'm using the TWR-MCF51CN-KIT to develop a project and I'm having trouble with the GPIO.


I'm working of the built in GPIO example to get started (***\Freescale\Freescale MQX 3.5\mqx\examples\gpio). I'm able to load this project and toggel the LED with the SW2 fine. Now I'm trying to toggle a GPIO on the side expansion port of the Functional Elevator (


In my main task of this example, I have:



void main_task ( uint_32 initial_data)

   FILE_PTR port_file_ID7;
   port_file_ID7   = fopen("gpio:write", (char_ptr) &pin_ID7 );
   while (TRUE)
   ioctl(port_file_ID7, GPIO_IOCTL_WRITE_LOG0, NULL);
   ioctl(port_file_ID7, GPIO_IOCTL_WRITE_LOG1, NULL);






where I declare ID7 as:


#define ID7     (GPIO_PORT_TD | GPIO_PIN3)


in a header file (ports defined in the MCF51CN datasheet, page 5,


However, when I probe this port (J9, pin/port 23 on the Functional Elevator schematic), I read no change in voltage. I tried doing this with a few other GPIOs (GPIO9, 8, 7, among others) with similar results.


Does anyone see anyhting overtly wrong with the code? Perhaps it's a hardware connection somewhere?


Any help would be appreciated.