Using Port DD as GPIO on MCF5282

Showing results for 
Search instead for 
Did you mean: 

Using Port DD as GPIO on MCF5282

Contributor I

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.

Labels (1)
0 Kudos
2 Replies

Specialist I

Do you have to use the BDM Debug pins as GPIO Outputs? You might want to use the BDM on your product.


A simple search in the User Manual for all cases of "ddata" finds: Debug Data (DDATA[3:0])
Debug data signals (DDATA[3:0]) display captured processor addresses, data and breakpoint status.
These pins can also be configured as GPIO PDD[7:4]. Chip Configuration Register (CCR)
4 Accessing an unimplemented address has no effect and causes a cycle termination transfer error.
To safeguard against unintentionally activating test logic, write 0x0000 to
the above reserved location during initialization (immediately after reset) to
lock out test features. Setting any bits in the CCR may lead to unpredictable


5 PSTEN PST[3:0]/DDATA[3:0] enable. This read/write bit enables the Processor Status (PST) and Debug
Data (DDATA)n functions of the external pins.
0 PST/DDATA function disabled.
1 PST/DDATA function enabled.




0 Kudos

Contributor I

Have read User's Manual, but have not found solution how to turn DDATA and PST MCU pins into GPIO mode.

And yes, I have to use these pins as GPIO, because hardware is done, not by me, and I have to use it.

0 Kudos