Using Port DD as GPIO on MCF5282

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Port DD as GPIO on MCF5282

630 Views
sskuce
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

234 Views
TomE
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:

 

14.2.14.7 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].

 

27.5.3.1 Chip Configuration Register (CCR)
4 Accessing an unimplemented address has no effect and causes a cycle termination transfer error.
NOTE
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
results.

...

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.

 

Tom

 

0 Kudos

234 Views
maksimzykov
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