Jim McPherson

Output Pin Manipulation for Coldfire 5212 (CodeWarrior)

Discussion created by Jim McPherson on Aug 31, 2006
Latest reply on Sep 11, 2006 by Nouchi
I am trying to raise and lower signals on Port TA (General Purpose Timers/PWM).

Port TA (to be set for General Purpose I/O):

GPT3 (Pin 43) – DCD1 (Uart1 - Modem)
GPT2 (Pin 42) – DTR1 (Uart1 - Modem)
GPT1 (Pin 41) – DCD0 (Uart0 - Host)
GPT0 (Pin 40) – DTR0 (Uart0 - Host)

// Port TA Setup
// GPT3 and GPT0 as GPIO inputs (DCD Modem and DTR Host)
// GPT2 and GPT1 as GPIO outputs (DTR Modem and DCD Host)
MCF_GPIO_DDRTA = 0 | MCF_GPIO_DDRTA_DDRTA2 //DTR Modem
| MCF_GPIO_DDRTA_DDRTA1; //DCD Host
MCF_GPIO_PTAPAR=0;
//////////////


I want to raise or lower DTR1 and DCD0 pins.

Is this correct?
//Raise DTR1 pin
MCF_GPIO_PORTTA = MCF_GPIO_SETTA | MCF_GPIO_PORTTA_PORTTA2

//Raise DCD0 pin
MCF_GPIO_PORTTA = MCF_GPIO_SETTA | MCF_GPIO_PORTTA_PORTTA1

//Lower DTR1 pin
MCF_GPIO_PORTTA = MCF_GPIO_CLRTA | MCF_GPIO_PORTTA_PORTTA2

//Lower DCD0 pin
MCF_GPIO_PORTTA = MCF_GPIO_CLRTA | MCF_GPIO_PORTTA_PORTTA1

It does not seem to work. Is this the correct code format to raise and lower outputs on the Coldfire 5212. Is there any code examples to manipulate output pins?

Thanks,

Outcomes