S3C2440 UART Programming

Publisher:camuspycLatest update time:2016-11-21 Source: eefocusKeywords:S3C2440  UART  Programming Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

//************UART query***************

extern void Init_check_uart()

{

rGPHCON |= 0xa0;

rGPHUP  = 0x0;

rULCON0 = 0x03;

rUCON0  = 0x05;

rUFCON0 = 0x00;

rUMCON0 = 0x00;

rUBRDIV0 = 53; //PCLK = 50MHz, baud rate 57600

deli(10);

}

extern void send_char(unsigned char c)

{

while(!(rUTRSTAT0 &0x04));

rUTXH0 = c;

}

extern void send_str(unsigned char *str)

{

int i=0;

while(str[i])

{

send_char((unsigned char) str[i++]);

}

}

//************UART interrupt**************

void __irq uart0_irq(void)

{

unsigned long irqOffSet;

Led_all_on();

deli(350);

Led_all_off();

deli(350);

irqOffSet = rINTOFFSET; // Get the interrupt number

rSUBSRCPND |= 1<<1;

rSRCPND |= 1<

rINTPND |= 1<<28; // Clear interrupt result

rUTXH0 = '1';

}

extern void Init_Interrupt_uart()

{

rGPHCON |= 0xa0;

rGPHUP  = 0x0;

rULCON0 = 0x03;

rUCON0  = 0x05;

rUFCON0 = 0x00;

rUMCON0 = 0x00;

rUBRDIV0 = 53; //PCLK = 50MHz, baud rate 57600

daily(100);

pISR_UART0 = (unsigned int)uart0_irq;

rINTSUBMSK &= ~(1<<1);

rINTMSK &= ~(1<<28);

rUTXH0 = '1';

deli(10);

}


Keywords:S3C2440  UART  Programming Reference address:S3C2440 UART Programming

Previous article:S3C2410 LCD driver learning experience
Next article:DNW download program address problem

Recommended ReadingLatest update time:2024-11-16 15:53

Analysis of the misaligned connection between Memory Controller and peripheral address lines of s3c2440
As shown in the s3c2440 data sheet: When the data bit width of the peripheral Flash is 8 bits, (the address line of the Memory Cotroller) A0——A0 (A0 of the peripheral Flash); When the data bit width of the peripheral Flash is 16 bits, (the address line of the Memory Cotroller) A1——A0 (A0 of the peripheral Flash);
[Microcontroller]
Analysis of the misaligned connection between Memory Controller and peripheral address lines of s3c2440
Sqlite 3.7.6.2 ported to PC and S3C2440 platforms
SQLite is a lightweight database and an ACID-compliant relational database management system. It is designed for embedded use and is currently used in many embedded products. It takes up very little resources and may only require a few hundred KB of memory in embedded devices. It supports mainstream operating system
[Microcontroller]
02 Linux entry command
1 Shell Interpreter The shell interpreter receives the input characters and displays them immediately. After you press Enter, it searches for the command based on the string. Where to search? It searches in the path specified by the environment variable. # Display environment variables echo $PATH # The results are a
[Microcontroller]
02 Linux entry command
The difference between MMU and MPU
The S3C2440 has an MMU, while the popular Cortex-M3/4 has an MPU. MMU vs MPU Memory is one of the most important components of a modern computer. Therefore, its contents cannot be tampered with by any errant application. This function can be achieved by an MMU (Memory Management Unit) or an MPU (Memory
[Microcontroller]
S3C2440 spi driver simple test
In the past two days, I referred to the information on the Internet and wrote an SPI driver myself, which passed the actual test. Hardware platform: mini2440 uses SPI1 of S3C2440 (there are 2 SPI modules in total) Operating system: linux-2.6.32.2 Test method: Short-circuit the MISO a
[Microcontroller]
ARM-Linux s3c2440 UART Analysis (Part 2)
This article is original from itspy. Please indicate the original source when copying/reprinting: http://blog.csdn.net/yyplc/article/details/7196290. Thank you! Software (linux-2.6.30.4): The serial port driver of the Linux system is different from the general character device. It adopts a hierarchical architecture
[Microcontroller]
ARM-Linux s3c2440 UART Analysis (Part 2)
【STM32CubeMX】HAL library interrupt mode UART serial communication
Under the HAL library, it is indeed simpler to use STM32CubeMX to generate source code, much simpler than using the standard library. Now summarize my learning process: Hardware platform: Zhengdian Atomic Explorer (STM32F407ZET6) 1. Configure STM32CubeMX (1) Open STM32CubeMX, select the corresponding chip mode
[Microcontroller]
【STM32CubeMX】HAL library interrupt mode UART serial communication
AVR USART (UART) send interrupt program using buffer
System functions    Use AVR's USART for self-transmission and self-reception (short-connect the transmit pin RXD to the receive pin TXD), send data: 0, 1, 2... data, and receive the data you send: 0, 1, 2... Use LED to make simple instructions!   hardware design
[Microcontroller]
AVR USART (UART) send interrupt program using buffer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号