Sam Skuce

Using Port DD as GPIO on MCF5282

Discussion created by Sam Skuce on Dec 24, 2010
Latest reply on Sep 29, 2014 by Maksim Zykov

I'm either missing something that should be very simple, or simply trying to do something that isn't possible.


I’ve got an MCF5282 that I’m trying to use PDD4 as a GPIO on.  In my setup code, I’ve got:


MCF5282_GPIO_DDRDD = 0x10;    /* output on dd4. */


And in my main loop, I’ve got:


MCF5282_GPIO_PORTDD = (mainloop_cnt & 0x10);


Which should give me a nice square wave on the oscilloscope, but the port doesn’t seem to be doing as I say.  Am I missing some setup steps?  I can’t find anything in the 5282 manual about a “Port DD pin-assignment register” to repurpose it from its “primary” role as DDATA.