Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use arm9 uart

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to use arm9 uart". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First of all, let's talk about the common places where serial ports appear: computers and development boards. On the pc, the serial port is the RS232 level, and the high level is:-5v; the low level is: + 5v~+15v. Note that the level is reversed once. The single-chip microcomputer is generally out of the voltage of less than 5v, so it needs to be converted before it can be connected. There are several kinds of chips commonly used in serial port. Here is a brief description: MAX232/MAX3232: RS232-TTL level conversion, which can convert the level of single-chip microcomputer and pc to each other.

PL2303: usb to serial port chip, now there are fewer and fewer pc with serial port. The better quality usb to serial port line is this chip, such as Lite, and this chip is used in openjtag.

CH340: usb to Serial Port (TTL), a chip of Nanjing Qinheng Company, mostly used for low-end adapter lines / boards

HL340:usb to serial port (RS232 level). HL340 = CH340 + MAX232

Serial port wiring diagram:

Data format:

Each transmission is sent in a frame format, and the format of the frame is determined in advance, such as how many data bits, whether there are parity bits (odd / even), several stop bits, and baud rate, etc.

The following is the TTL level, 7 data bits, even parity, 2 stop bits format output'A'.

ULCON0 = 0x3; / / 8 N 1 normal mode

UCON0 = 0x5; / / query method, clock source PCLK

UFCON0 = 0; / / do not use FIFO

UMCON0 = 0; / / No flow control is used

Baud rate:

# the clock_init function in # define PCLK 50000000 / / init.c sets PCLK to 50MHz#define UART_CLK PCLK / / UART0 clock source to PCLK#define UART_BAUD_RATE 115200 / / baud rate # define UART_BRD ((UART_CLK / (UART_BAUD_RATE * 16))-1) UBRDIV0 = UART_BRD

There is also the serial port status register:

Rx/tx status register

/ / receive character # define TXD0READY (1

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report