//************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); }
Previous article:S3C2410 LCD driver learning experience
Next article:DNW download program address problem
Recommended ReadingLatest update time:2024-11-16 15:53
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MakeCode driver for the magnetic field sensor LIS2MDL
- Very detailed filter basics
- EEWORLD University Hall----Live Replay: How to solve the challenge of precision timing in ADAS systems
- When will it end? ST is out of stock and it is hard to find a domestic alternative, but the domestic ones are also out of stock...
- [Mil MYC-JX8MPQ Review] 3. GPIO Application Programming
- 【Laser target detector】I2C and SPI
- The inverter outputs a sine wave, so how do we measure the harmonics and waveform distortion of the output voltage?
- Understand the MSP430F149 comparator by looking at a picture
- MOS tube knowledge
- 【GD32L233C-START Review】-I. Unboxing and Hardware Appreciation