i'am new to this MPC5604B 32 bit controller.i wanted to make port F as output port.how do i make it. And i need to send 16bit data out of these port continuosly .how do i do it.Will this piece of code work.Thank you.
for(j=0;j<16;j++)
{
SIU.PCR[80 + j].R = 0x0200;
}
while(1)
{
SIU.PGPDO[2].R = 0x0000FFFF;
}
Solved! Go to Solution.
Oh my god, I got it
instead of
for(j=0;j<16;j++)
{
SIU.PCR.R[80+j] = 0x0200;
}
i did used this
for(j=0;j<16;j++)
{
SIU.PCR.R[80+j] = 0x0203;
}
Now it works
why no one replying to this question.it is very urgent.plz replay
> why no one replying to this question.it is very urgent.plz replay
Mainly because your code doesn't show the sending of any data at all. You don't say what sort of output you want. Do you want to control single bits on and off or are you trying to write data to a 16 bit peripheral? If you want the latter then tou haven't mentioned write strobes or control pins.
if it is so urgent, have you TRIED your code at all? What happened?
Have you searched for example code anywhere? Have you downloaded Linux ports and looked for examples?
for(j=0;j<16;j++){ SIU.PCR[80 + j].R = 0x0200;}
That looks like it should set the 16 pins to be GPIO outputs.
while(1){ SIU.PGPDO[2].R = 0x0000FFFF;}
Without seeing the code that defines what ".R" means I have no idea. You want to write your user data as a 16-bit write to the lower 16 bits. There's probably a definition in the header where ".R" means 32-bit write and there are two other ones that mean "16 bit upper" and "16 bit lower". You should be using one of them.
Continuously writing in a hard loop isn't going to do anything useful. You only have to write data ONCE for the port to then drive that data until you write something else to the port.
Tom
Oh my god, I got it
instead of
for(j=0;j<16;j++)
{
SIU.PCR.R[80+j] = 0x0200;
}
i did used this
for(j=0;j<16;j++)
{
SIU.PCR.R[80+j] = 0x0203;
}
Now it works