Hi Christian,
There is an errata that affects the Clock control high register (CCHR), causing the writes to the clock control high register to have no effect, even though reading this register shows it has been updated.
You can find more information on this document:
http://cache.freescale.com/files/32bit/doc/errata/MCF52235DE.pdf
I would recommend you to try using the following code:
replace the system clock initialization code on the Cpu.c file with the following:
/* System clock initialization */
// Clock source is 25.0000 MHz external crystal
// Clock mode: Normal PLL mode
// Processor/Bus clock frequency = 60.00 MHz
// Loss of clock detection disabled
// Reset on loss of lock disabled
// Divide 25.0000 MHz clock to get 5.00 MHz PLL input clock
// Set RFD+1 to avoid frequency overshoot and wait for PLL to lock
setReg16(SYNCR, 0x4103U); /* Set the SYNCR register */
while (!(SYNSR & SYNSR_LOCK_BITMASK)){} /* Wait until the PLL is locked. */
// Set desired RFD=0 and MFD=4 and wait for PLL to lock
setReg16(SYNCR, 0x4003U);
while (!(SYNSR & SYNSR_LOCK_BITMASK)){} /* Wait until the PLL is locked. */
/* RTCDR: RTCDF=0x007A11FF */
setReg16(SYNCR, 0x4007U);// Switch to using PLL
and change the AS1_Init code on the AS1.c file with the following:
void AS1_Init(void)
{
SerFlag = 0x00; /* Reset flags */
/* UCR0: ??=0,MISC=3,TC=0,RC=0 */
setReg8(UCR0, 0x30U); /* Reset UART transmitter */
/* UCR0: ??=0,MISC=2,TC=0,RC=0 */
setReg8(UCR0, 0x20U); /* Reset UART receiver */
/* UMR10: RXRTS=0,RXIRQ=0,ERR=0,PM=2,PT=0,BC=3 */
setReg8(UMR10, 0x13U); /* Set the UMR1 register */
/* UMR20: CM=0,TXRTS=0,TXCTS=0,SB=7 */
setReg8(UMR20, 0x07U); /* Set the UMR2 register */
/* UCSR0: RCS=0x0D,TCS=0x0D */
setReg8(UCSR0, 0xDDU);
/* UBG10: Divider_MSB=0 */
setReg8(UBG10, 0x00U);
/* UBG20: Divider_LSB=0x61 */
setReg8(UBG20, 0x61U);
HWEnDi(); /* Enable/disable device according to status flags */
}
With this you should get the desired 19200 baud rate.
To prevent Processor Expert of overwriting the above changes to the code you need to disable the code generation of those components, here is a post created by a colleague that explains how to do this:
Disable my Code Generation | MCU on Eclipse
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------