首页 UART_internal_BRG

UART_internal_BRG

举报
开通vip

UART_internal_BRGLPC932 Example: Communication with the PC using the serial interface (UART) Christian Kulig, 12/05/02 Introduction: The LPC932 has an enhanced UART which is compatible with the conventional 80C51 UART. It can be used directly as a serial interface to excha...

UART_internal_BRG
LPC932 Example: Communication with the PC using the serial interface (UART) Christian Kulig, 12/05/02 Introduction: The LPC932 has an enhanced UART which is compatible with the conventional 80C51 UART. It can be used directly as a serial interface to exchange data with other microcontrollers. To communicate with a PC it is necessary to adapt the voltage levels from 0V and 3.3V (CMOS levels of LPC900 UART) to -10V and +10V (RS232 specification of PC com-port). There are several IC's which are suitable for this task, e.g. the MAX232 or the LTC1386. These devices are supplied with 3.3V or 5V and have a on-chip charge pump for providing the +/-10V. Please notice, that the Keil EPM900 Board does not include these devices, therefore this example can't be tested directly with the EPM900. To transfer data, the UART uses a certain baud rate (bits per second), which must be the same for the transmitter and the receiver. For PCs there are standard baud rates like 1200, 4800, 9600 and so on, which should be used for the UART of the microcontroller as well. On the LPC932 the source for the baud rate can be e.g. the Timer 1 overflow or the independent Baud Rate Generator (BRG). Both divide the clock frequency (Crystal, internal RC oscillator) by a certain factor, so that many different baud rates can be achieved. Description: This example shows how to use the UART to communicate with a PC: It sets up the 8 data bits mode with 1 stop bit and no parity bit. The baud rate source is the internal Baud Rate Generator, which is set up to provide a baud rate of 9600 at an oscillator frequency of 12 MHz (=external resonator). To have access to the com port of the PC, start the program 'Hyperterminal'. (START -> PROGRAMS -> ACCESSOIRES -> COMMUNICATIONS -> HYPERTERMINAL) Click on 'Properties' and check the following settings: 9600 baud, 8 data bits, 1 stop bit and no flow control. To begin the communication click on 'Call'. The LPC932 waits for a command ('S'), which is sent by 'Hyperterminal' and sends back a response which is displayed on the screen.
本文档为【UART_internal_BRG】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_064498
暂无简介~
格式:doc
大小:21KB
软件:Word
页数:0
分类:互联网
上传时间:2018-09-10
浏览量:3