* MPC5200 - Problem with PSC mode
@ 2006-01-28 23:02 Moloko Vellocet
0 siblings, 0 replies; 4+ messages in thread
From: Moloko Vellocet @ 2006-01-28 23:02 UTC (permalink / raw)
To: linuxppc-embedded
Hi, I'm configuring a MPC5200 in PSC3 mode to communicate with a
telephony board that send information to the MPC5200 continuously. In
the osciloscope I see the signals comming via RX pin, but when I read
RX buffer it doesn't contain anything and when I write in the TX
buffer the flags show that buffer is not empty, but in the osciloscope
I don't see any signal in TX pin. I can't enable the interrupt mode
too.
Can anyone help me?
Part of the configuration code:
out_8(&psc->command, MPC5xxx_PSC_TX_DISABLE | MPC5xxx_PSC_RX_DISABLE);
val32 =3D in_be32(&gpio->port_config);
val32 &=3D ~0x700;
val32 |=3D 0x600;
out_be32(&gpio->port_config, val32);
out_8(&psc->command, MPC5xxx_PSC_RST_RX |
MPC5xxx_PSC_RST_TX |
MPC5xxx_PSC_SEL_MODE_REG_1 |
MPC5xxx_PSC_RST_ERR_STAT);
out_be16(&psc->mpc5xxx_psc_imr, 0);
out_be16(&psc->rfalarm, 0x0004);
out_be16(&psc->tfalarm, 0x0004);
out_be32(&psc->sicr, 0x221000);
out_8(&psc->command, MPC5xxx_PSC_RST_RX |
MPC5xxx_PSC_RST_TX |
MPC5xxx_PSC_SEL_MODE_REG_1 |
MPC5xxx_PSC_RST_ERR_STAT);
spin_lock_irqsave(&mpc5xxx_serial_lock, my_flags);
val16 =3D in_be16(&psc->mpc5xxx_psc_imr);
val16 =3D MPC5xxx_PSC_IMR_TXRDY | MPC5xxx_PSC_IMR_RXRDY;
out_be16(&psc->mpc5xxx_psc_imr, val16);
spin_unlock_irqrestore(&mpc5xxx_serial_lock, my_flags);
out_8(&psc->command, MPC5xxx_PSC_RX_ENABLE | MPC5xxx_PSC_TX_ENABLE);
So.. with this I tried to read the RX and write in TX buffer.
Thank you.
--
_______________________________
Allann J. O. Silva
"I received the fundamentals of my education in school, but that was
not enough. My real education, the superstructure, the details, the
true architecture, I got out of the public library. For an
impoverished child whose family could not afford to buy books, the
library was the open door to wonder and achievement, and I can never
be sufficiently grateful that I had the wit to charge through that
door and make the most of it." (from I. Asimov, 1994)
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: MPC5200 - Problem with PSC mode
@ 2006-01-30 14:18 Zeitler, Nathan
2006-01-30 19:30 ` Moloko Vellocet
0 siblings, 1 reply; 4+ messages in thread
From: Zeitler, Nathan @ 2006-01-30 14:18 UTC (permalink / raw)
To: allanjos; +Cc: linuxppc-embedded
Hi Allann,
> out_8(&psc->command, MPC5xxx_PSC_RST_RX |
> MPC5xxx_PSC_RST_TX |
> MPC5xxx_PSC_SEL_MODE_REG_1 |
> MPC5xxx_PSC_RST_ERR_STAT);
It looks like you're trying to do too many things at once here. =20
ORing SEL_MODE_REG_1 and RST_ERR_STAT together=20
forms a completely different command in the Command=20
register. You may want to break that into two lines of code. =20
Give that a try!
Open Systems International, Inc.=20
Nathan Zeitler
Hardware Engineer
3600 Holly Lane North, Suite 40
Minneapolis, MN 55447-1286
Phone: 763 551 0559
Fax: 763 551 0750
E-mail: nzeitler@osii.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200 - Problem with PSC mode
2006-01-30 14:18 Zeitler, Nathan
@ 2006-01-30 19:30 ` Moloko Vellocet
0 siblings, 0 replies; 4+ messages in thread
From: Moloko Vellocet @ 2006-01-30 19:30 UTC (permalink / raw)
To: linuxppc-embedded
Thank you.
But the error persists, I can't get data stored in RX pin and write
data to TX pin.
Registers like 'rfnum' are with value '0' (zero).
I think that RX and TX has not been enabled.
On 1/30/06, Zeitler, Nathan <nzeitler@osii.com> wrote:
> Hi Allann,
>
> > out_8(&psc->command, MPC5xxx_PSC_RST_RX |
> > MPC5xxx_PSC_RST_TX |
> > MPC5xxx_PSC_SEL_MODE_REG_1 |
> > MPC5xxx_PSC_RST_ERR_STAT);
>
> It looks like you're trying to do too many things at once here.
> ORing SEL_MODE_REG_1 and RST_ERR_STAT together
> forms a completely different command in the Command
> register. You may want to break that into two lines of code.
> Give that a try!
>
> Open Systems International, Inc.
> Nathan Zeitler
> Hardware Engineer
> 3600 Holly Lane North, Suite 40
> Minneapolis, MN 55447-1286
> Phone: 763 551 0559
> Fax: 763 551 0750
> E-mail: nzeitler@osii.com
>
--
_______________________________
Allann J. O. Silva
"I received the fundamentals of my education in school, but that was
not enough. My real education, the superstructure, the details, the
true architecture, I got out of the public library. For an
impoverished child whose family could not afford to buy books, the
library was the open door to wonder and achievement, and I can never
be sufficiently grateful that I had the wit to charge through that
door and make the most of it." (from I. Asimov, 1994)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200 - Problem with PSC mode
@ 2006-01-30 22:34 Zeitler, Nathan
0 siblings, 0 replies; 4+ messages in thread
From: Zeitler, Nathan @ 2006-01-30 22:34 UTC (permalink / raw)
To: linuxppc-embedded
Allann,
Hmm, yes. In addition, these lines looks suspect:
> val32 =3D in_be32(&gpio->port_config);
> val32 &=3D ~0x700;
> val32 |=3D 0x600;
> out_be32(&gpio->port_config, val32);
I don't have the register's header file in front of me, but I'm
pretty sure this refers to MBAR+0xb00. If that's the case,=20
you seem to be configuring the port to be in CODEC mode=20
and not UART mode. Try this instead:
val32 =3D in_be32(&gpio->port_config);
val32 &=3D ~0xf00;
val32 |=3D 0x400;
out_be32(&gpio->port_config, val32);
You may want to refer to the MPC5200 manual. Page 15-43
has a nice sequence you can go through to configure a port
to be a UART.
Open Systems International, Inc.=20
Nathan Zeitler
Hardware Engineer
3600 Holly Lane North, Suite 40
Minneapolis, MN 55447-1286
Phone: 763 551 0559
Fax: 763 551 0750
E-mail: nzeitler@osii.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-01-30 22:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-28 23:02 MPC5200 - Problem with PSC mode Moloko Vellocet
-- strict thread matches above, loose matches on Subject: below --
2006-01-30 14:18 Zeitler, Nathan
2006-01-30 19:30 ` Moloko Vellocet
2006-01-30 22:34 Zeitler, Nathan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).