UART initialization

with my friends we are doing school project. One part of this project requires UART initialization. This is first time we are using such processor(CF5282), until now we were only using M68HC11. Problem is that we can't get UART to work at all. I think we set correctly everything, but on PC we don't receive anything. Our setting are 9600bps, 8bits per char, 1 stop bit, no parity. Can somebody tell us what did we wrong?

I haven't checked your code, but I have another suggestion. Have you checked that you've set up the UART pins correctly in the GPIO module? Without this, everything might be working fine in the UART code but the signals never make it to the outside world.

On the MCF5282, there are more possible I/O signals than there are physical pins to accomodate them all. To handle this, it's necessary to pick from a list of different functions assigned to a pin, and then select this using the pin multiplexing feature.

To do this, you typically need to set up the PAR register which applies to the pins you want to configure. For UART 0, the signals Tx and Rx are part of GPIO port UA, and so configured with the PUAPAR register. You would need to do something like:

thanks for information about that register. My code is working at the moment, but something is very strange with baud rate. There are 3 registers for setting baudrate. With UCSR1 we can choose between external clock or prescaled(divider 32) system clock. In second case we have to set additional 16 bit divider(registers UBG21 and UBG11). I have used formula from manuals, that means divider=SYSCLOCK/(32*baudrate). I belive(Is there any other frequency possible?) that my CF5282 on development board works on 66Mhz. In my case I need baud rate 9600 bps, so I had to set divider registers to 0x00 and 0xD6. Problem is that UART transfer between CF and PC doesn't work at 9600 bps. There are some strange characters appearing. The most interesting thing is that when I change baudrate on PC to 4800 bps it looks like that transfer works. Can anybody explain this?