Init ports 5282

cancel
Showing results for 
Search instead for 
Did you mean: 

Init ports 5282

1,417 Views
Lucho
Contributor I
I need some help to init the ports in the coldfire 5282. I have the next simple program but the problem is that I can not do the PORTE an IN PUT port.

int main()
{
MCF5282_GPIO_PEPAR = 0x00;
MCF5282_GPIO_DDRE = 0X00;      //For In put
MCF5282_GPIO_PFPAR = 0x00;
MCF5282_GPIO_DDRF = 0XFF;      //For Out put
    while(1)
   {
       MCF5282_GPIO_PORTE = MCF5282_GPIO_PORTF;
   }
   return 0;
}


I do not know if i miss something for complete the declaration IN PUT port so if some body can send me a exemple of program that recive something I will be thankful :smileyhappy:.
Labels (1)
0 Kudos
2 Replies

168 Views
Lucho
Contributor I
Thank I didn't see that but not only this port is my problem else all of the ports that I like to used like IN PUT port I can't use them like IN PUT as PORTB, PORTC, PORTD and this registers are of 8 bits
 
#define MCF5282_GPIO_PBCDPAR   (*(vuint8  *)(void *)(&__IPSBAR[0x100050]))
 
and using the similar instrution of program:
 
int main()
{
   MCF5282_GPIO_PBCDPAR = 0x00
   MCF5282_GPIO_DDRB = 0xFF;   //OUT PUT PORT
    MCF5282_GPIO_DDRC = 0X00;   //IN PUT PORT
   while(1)
    {
        MCF5282_GPIO_PORTC =    MCF5282_GPIO_PORTC           ;
     }
 
return 0;
}
 
I did the same structure program with other ports but I have nothing when I send information to the PORTC.
0 Kudos

168 Views
Tang
Contributor I
Pay attemtion to the MCF5282_GPIO_PEPAR  is 16bit  width,see below:

#define MCF5282_GPIO_PEPAR      (*(vuint16 *)(void *)(&__IPSBAR[0x100052]))
0 Kudos