摘要: /********************************************************************************************************** File : ws_usart_port.h* Hardware Environment:* Build Environment : Silicon LABs 3.42.00 / uV ...
/********************************************************************************************************
*
* File : ws_usart_port.h
* Hardware Environment:
* Build Environment : Silicon LABs 3.42.00 / uVision3 V3.80 20100913
* Version :
* By : Su Wei Feng
*
*(c) Copyright 2005-2010, WaveShare
*http://www.waveshare.net
*All Rights Reserved
*
*********************************************************************************************************/
#ifndef _WS_USART_PORT_H_
#define _WS_USART_PORT_H_
/*Hardware Environment:DVK501 && F320 EX*/
#if defined(_DVK501_F320_EX_)
/****************************************************
USART0 initialization
Communication Parameters: 8 Data, 1 Stop, No Parity
USART0 Baud Rate: 9600
****************************************************/
void usartInit(void)
{
XBR0 |= 0x01;
P0MDOUT |= 0x10;
SCON0 |= 0x10;
CKCON &= ~0x0B; // T1M = 0; SCA1:0 = 01
CKCON |= 0x01;
TH1 = 0x64;
TL1 = TH1;
TMOD &= ~0xf0; // TMOD: timer 1 in 8-bit autoreload
TMOD |= 0x20;
TR1 = 1;
TI0 = 1;
}
#else
#warning "USART interface undefined."
#endif
#include <../../../../library/C8051F/ws_usart.h>
#endif /*_WS_USART_PORT_H_*/
/********************************************************************************************************
*
* File : ws_usart.h
* Hardware Environment:
* Build Environment : Silicon LABs 3.42.00 / uVision3 V3.80 20100913
* Version :
* By : Su Wei Feng
*
* (c) Copyright 2005-2010, WaveShare
* http://www.waveshare.net
* All Rights Reserved
*
*********************************************************************************************************/
#ifndef _WS_USART_H_
#define _WS_USART_H_
void putUsart0(uchar c)
{
SBUF0 = c;
}
uint getUsart0(void)
{
flying res;
res = SBUF0;
return res;
}
#endif /*_WS_USART_H_*/
Previous article:Use C8051F's serial port to send and receive data from MAX3232
Next article:Use C8051F's serial port to send and receive data from MAX485
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Playing with Zynq Serial 41——[ex60] Image smoothing processing of OV5640 camera
- Thank you + thank you EEWORLD community
- Medical electronics popular data download collection
- GaN Power Devices
- PIN diodes for RF circuits explained in detail
- During the fight against the epidemic, we will teach you how to have instruments in your mind without having any in your hands.
- K210 performance test again
- 5G high-frequency board material selection and multi-layer board design requirements
- EETALK: What changes has the epidemic brought about in technology?
- "Playing with the board" + Yu Zhennan's STM32 development board experiment 4