Embedded Systems Design Europe - November 2007 - (Page 19) microcontrollers I/O pins can solve these design issues. UART communication isn’t a master/ slave type of communication. Instead, it’s a one-on-one connection, with both sides being able to communicate at any time. However, many peripheral devices work in the slave mode. That is, they don’t initiate communication on their own. Instead, they wait for the host MCU to send commands. It’s easier to handle these devices by time-multiplexing the UART. As shown in Figure 4, the four UART-based peripherals are connected to remappable pins on the MCU. The control program will dynamically map a UART in hardware to these four pin sets, based on the application’s need. The multiple-UART interface works as follows: when the application wants to talk to device 1, the program will map the hardware UART to the RP1 and RP2 pins. This mapping is done by changing the pin-mapping registers, communicating with the device and getting all of the required data. When the MCU wants to talk to device 2, the program will map the hardware UART to the RP3 and RP4 pins, by changing flexible pin mapping registers, and so on. If the MCUs with UART peripherals are a combination of slave devices and also need one asynchronous channel to receive data at any point, you have a few options. Usually these kinds of MCUs have two hardware UART modules. One of the hardware UART modules can be an asynchronous communication channel, and the second can be used for time multiplexing – to create multiple hardware UART modules. If you’re one of those designers who really likes to push the envelope, and have a need for both multiple asynchronous channels and multiple slave channels, a multiplexer-based flexible pin-mapping scheme can help you. If an MCU’s asynchronous channel has a handshaking capability (Data Terminal Ready [DTR]/ Clear To Send [CTS]), you can use those signals to hold the asynchronous channel while you map the UART back to the original pin. Another option is to map an edge interrupt or an input-capture signal onto the inactive UART receive pin. If another device starts an asynchronous transfer, the MCU will be interrupted. It can immediately switch the hardware UART module to the appropriate pins to receive data. The pins can be remapped in microseconds, depending on the MCU’s speed. This should pose no problems, because most UART communication takes place at slower speeds. Therefore, a hardware UART will still be able to receive that data. This solution may not work for some special systems that need all UARTs to be asynchronous channels. Gaurang Kavaiya (gaurang.kavaiya@ microchip.com) is an engineering group manager of applications in the Advanced Microcontroller Architecture Division at Microchip Technology Inc. www.embedded.com/europe | embedded systems design europe | NOVEMBER – DECEMBER 2007 19 015-016-017-018-019_ESDE.indd 19 8/11/07 10:41:13 http://www.lauterbach.co.uk http://www.lauterbach.de http://www.lauterbach.it http://www.lauterbach.com http://www.lauterbach.cn http://www.lauterbach.co.jp http://www.lauterbach.com http://www.embedded.com/europe
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.