MPC5200 baud rate frequency

I have a Freescale MPC5200 board I designed a while ago which comes out of reset (I am writing the flash with a debug monitor which has served me over the years - I wrote it first for the 68020, then I made a CPU32 version, then an MPC8240 version etc...), and the monitor says something through the UART (I use PSC_6).

But the baud rate is totally off the mark.

I made the other system say the same through its UART and, measuring the length (43 characters, enough to get an idea if speeds match) I see the new system is apr. 2.7 times slower than it should be.

Great, I though I'd just write a 2.7 times lower value in the counter timer and see what happens. Well, the thing is, nothing happened. Same time (2.7 times what it should be) again. I just love that kind of thing when you make dramatic changes only to achieve no change. I am writing to the so called Counter Timer Upper and then Lower registers, treat them as 8 bit wide (i.e. I write using a .b access, stb) and I write the value of 215, which should yield a 19200 baud given the 132 MHz IPB clock. I already described the effect of changing the 215 to 79 (or sort of, I lost the precise number, it was not exactly 2.7, so it may have been 78 or 80, not that it matters).

I am tired now and will reluctantly go to sleep (I hate doing that with unsolved basic issues like that). Hopefully someone will have an idea what am I doing wrong which will help me tomorrow...

Thanks,

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

Reply to
Didi
Loading thread data ...

Not being familar with that hardware I see three possible mistakes.

I hope the new day has brought you success.

1> you were writing the correct value but later overwriting it 2> you were writing the correct value but to the wrong location 3> you were writing the correct value but with an incorrect setup

It may be worth checking the errata in the hardware documentation. Bye. Jasen

Reply to
jasen

Ah, it did, thanks. There had been more to it than just the baud rate, I rewrote the UART initialization code in a less ambitious manner (thus more reasonable for a first-time out of reset CPU type here) and it worked.

Dimiter

Reply to
Didi

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.