I have a problem with serial comunication - when I put '8', I receive some unusual characters like 'Ć', and then '8'. On the end - error. I did something wrong?
You should only open and close the serial port ONCE. Open and configure the serial port before the loop and close it after the loop. You can read and write inside the loop all you want then. I've seen weird situations where constantly configuring the port will give you weird random characters.
You should probably also use an Event Structure to control when the buffer is written. For instance, only write out of the serial port when you hit a "Send" button.
Are you using a loopback cable? Or are you trying to talk to an instrument that is just sending back the data you sent?
Could you show me example of solution similar to my problem? I did as you tell, but still problems occur. Maybe not weird characters but slow transmission and I have to reset my program before sending one character. I'm using USB cable with RS-232 adapter. Microcontroler Atmega32A (pins TxD and RxD are in charge of data transmission)