I am pretty confused between USART and UART because the 2 terms seem to be used interchangeably.
The Atmega328 supports USART. But how do we specify when to use USART or UART? What if the remote end supports only UART and not USART? My guess is that Arduino uses the asynchronous version by default and cannot use synchronous version. Is it because this is due to the Arduino libraries?
westfw:
The AVR USART has a "synchronous" mode that you can set up in its configuration register (not directly supported by any Arduino firmware.)
However, it's a pretty poor "synchronous" device by (say) Datacomm standards.
Only one external clock signal.
Still (apparently) only supports "async" style byte formats (start bit, stop bit.)
that means no idle character generation or recognition, no bit-stuffing, no HDLC-style packets, no CRC support...
I'm not sure exactly what it is supposed to be useful for
Is it right to say that Arduino cannot do the synchronous aspect of USART. To do that, one has to use AVR Studio?
No, one could do it using the arduino IDE, but it would require writing a synchronous serial library and installing it into the users libraries folder and using it's commands rather then the standard arduino Serial library. Even if moving to AVR Studio would still require writing or obtaining a synchronous serial functions.
I need to interface Arduino to a module which uses synchronous UART. To my dismay, even with Arduino's rich support for libraries, I cannot find anything on Google regarding synchronous serial communication being done on Arduino. Also, although Atmega328 supports USART, I do not see any additional clock signal pin that can be used for synchronous communication. Can Atmega328 really support synchronous UART properly?
lightaiyee:
I need to interface Arduino to a module which uses synchronous UART. To my dismay, even with Arduino's rich support for libraries, I cannot find anything on Google regarding synchronous serial communication being done on Arduino. Also, although Atmega328 supports USART, I do not see any additional clock signal pin that can be used for synchronous communication. Can Atmega328 really support synchronous UART properly?
Yes it can. You really need to study the AVR datasheet to understand the capabilities and how to utilize the AVR USART hardware. There is a clock pin called XCK (device pin 6 in the DIP package) that is used for synchronous mode, as an input pin if in slave mode or as a output pin if in master mode. The hardware functionality is all there it's just up to you to write or locate a software library to support it.