SVC2 wrote:
Hi,
I am trying to configure portE on 5282 without success. I would like to have PE2 and PE3 configured as output. So I am setting:
(snip)
MCF5282_GPIO_DDRE = 0x8 | 0x4;
MCF5282_GPIO_PEPAR = 0;
I am trying to toggle the pin using:
MCF5282_GPIO_PORTE |= (0x8);// set 1
MCF5282_GPIO_PORTE &= ~(0x8);// set 0
It DOES NOT work.
What I am doing wrong?
Thanks,
S.
PS: I also tried:
(snip)MCF5282_GPIO_SETE |= 0x8;
MCF5282_GPIO_CLRE |= 0x8;
If your 5282 powers up in "master" mode (with an external bus), those pins are used for SIZ[1:0] and controlled by the CCR register. This is the default even if your program never writes the CCR, and the CCR setting prevents your write to the PEPAR from having the desired effect.
Once you get past the configuration issues, the SETE and CLRE registers should be used with simple assignments. The whole idea is to make bit output easier than |= or &=~ on the PORTE register:
MCF5282_GPIO_SETE = 0x8;
MCF5282_GPIO_CLRE = 0x8;
Message Edited by bkatt on 2009-05-05 02:27 PM
Message Edited by bkatt on 2009-05-05 02:28 PM