5282 Ports

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

5282 Ports

1,800 Views
Lucho
Contributor I
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_PORTB =    MCF5282_GPIO_PORTC;
     }
 
return 0;
}
 
With the last program I can do that the PORTB oun the data that the PORTC recive, I don't know if the declaration of the register are in a wrong way or what if some body have an example of program that declarete a IN PUT port I will be thanksful :smileyvery-happy:
Labels (1)
0 Kudos
2 Replies

329 Views
Tang
Contributor I
Hello,
You can see below in MCF5282UM:

Reading a PORTn register returns the current values in the register, not the port n pin values.
And reading a PORTnP/SETn register returns the current state of the port n pins.

0 Kudos

329 Views
Pai
Contributor I
Hi, How do you use this micro-controller: in master mode or single chip mode? in master mode ports A,B,C D have dedicated function (address bus, data bus) so it is quite normally to behave different than you like. Regards, Pai
0 Kudos