亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cpu.h

?? Keil C 51單片機(jī)串口通信程序, 通過該程序可以了解和使用單片機(jī)串口通信
?? H
?? 第 1 頁 / 共 3 頁
字號:

#include <stdio.h>
#include <ctype.h>
#include <absacc.h>
#include <intrins.h>
#include <math.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

////////////////////
// BYTE Registers //
////////////////////

/* 8051 standard */
sfr P0    = 0x80; // PORT 0, P0.7 P0.6 P0.5 P0.4 P0.3 P0.2 P0.1 P0.0
sfr SP    = 0x81; // STACK POINTER, SP.7 SP.6 SP.5 SP.4 SP.3 SP.2 SP.1 SP.0
sfr DPL   = 0x82; // DATA POINTER LOW, DPL.7 DPL.6 DPL.5 DPL.4 DPL.3 DPL.2 DPL.1 DPL.0
sfr DPH   = 0x83; // DATA POINTER HIGH, DPH.7 DPH.6 DPH.5 DPH.4 DPH.3 DPH.2 DPH.1 DPH.0
sfr PCON  = 0x87; // POWER CONTROL, SM0D SMOD0 - - GF1 GF0 PD IDL
sfr TCON  = 0x88; // TIMER CONTROL, TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0
sfr TMOD  = 0x89; // TIMER MODE CONTROL, GATE C/T M1 M0 GATE C/T M1 M0
sfr TL0   = 0x8A; // TIMER 0 LSB, TL0.7 TL0.6 TL0.5 TL0.4 TL0.3 TL0.2 TL0.1 TL0.0
sfr TL1   = 0x8B; // TIMER 1 LSB, TL1.7 TL1.6 TL1.5 TL1.4 TL1.3 TL1.2 TL1.1 TL1.0
sfr TH0   = 0x8C; // TIMER 0 MSB, TH0.7 TH0.6 TH0.5 TH0.4 TH0.3 TH0.2 TH0.1 TH0.0
sfr TH1   = 0x8D; // TIMER 1 MSB, TH1.7 TH1.6 TH1.5 TH1.4 TH1.3 TH1.2 TH1.1 TH1.0
sfr P1    = 0x90; // PORT 1, P1.7 P1.6 P1.5 P1.4 P1.3 P1.2 P1.1 P1.0
sfr SCON  = 0x98; // SERIAL PORT CONTROL, SM0/FE SM1 SM2 REN TB8 RB8 TI RI
sfr SBUF  = 0x99; // SERIAL DATA BUFFER, SBUF.7 SBUF.6 SBUF.5 SBUF.4 SBUF.3 SBUF.2 SBUF.1 SBUF.0
sfr P2    = 0xA0; // PORT 2, P2.7 P2.6 P2.5 P2.4 P2.3 P2.2 P2.1 P2.0
sfr IE    = 0xA8; // INTERRUPT ENABLE, EA ES1 ET2 ES ET1 EX1 ET0 EX0
sfr P3    = 0xB0; // PORT 3, P3.7 P3.6 P3.5 P3.4 P3.3 P3.2 P3.1 P3.0
sfr IP    = 0xB8; // INTERRUPT PRIORITY, - PS1 PT2 PS PT1 PX1 PT0 PX0
sfr PSW   = 0xD0; // PROGRAM STATUS WORD, CY AC F0 RS1 RS0 OV F1 P
sfr ACC   = 0xE0; // ACCUMULATOR, ACC.7 ACC.6 ACC.5 ACC.4 ACC.3 ACC.2 ACC.1 ACC.0
sfr B     = 0xF0; // B REGISTER, B.7 B.6 B.5 B.4 B.3 B.2 B.1 B.0

/* 8052 Extensions */
sfr T2CON  = 0xC8; // TIMER 2 CONTROL, TF2 EXF2 RCLK TCLK EXEN2 TR2 C/T2 CP/RL2
sfr T2MOD  = 0xC9; // TIMER 2 MODE CONTROL, HC5 HC4 HC3 HC2 T2CR - T2OE DCEN
sfr RCAP2L = 0xCA; // TIMER 2 CAPTURE LSB, RCAP2L.7 RCAP2L.6 RCAP2L.5 RCAP2L.4 RCAP2L.3 RCAP2L.2 RCAP2L.1 RCAP2L.0
sfr RCAP2H = 0xCB; // TIMER 2 CAPTURE MSB, RCAP2H.7 RCAP2H.6 RCAP2H.5 RCAP2H.4 RCAP2H.3 RCAP2H.2 RCAP2H.1 RCAP2H.0
sfr TL2    = 0xCC; // TIMER 2 LSB, TL2.7 TL2.6 TL2.5 TL2.4 TL2.3 TL2.2 TL2.1 TL2.0
sfr TH2    = 0xCD; // TIMER 2 MSB, TH2.7 TH2.6 TH2.5 TH2.4 TH2.3 TH2.2 TH2.1 TH2.0

/* WinBond extension */
sfr DPL1   = 0x84; // DATA POINTER LOW1, DPL1.7 DPL1.6 DPL1.5 DPL1.4 DPL1.3 DPL1.2 DPL1.1 DPL1.0
sfr DPH1   = 0x85; // DATA POINTER HIGH1, DPH1.7 DPH1.6 DPH1.5 DPH1.4 DPH1.3 DPH1.2 DPH1.1 DPH1.0
sfr DPS    = 0x86; // DATA POINTER SELECT, - - - - - - - DPS.0
sfr CKCON  = 0x8E; // CLOCK CONTROL, WD1 WD0 T2M T1M T0M MD2 MD1 MD0
sfr EXIF   = 0x91; // EXTERNAL INTERRUPT FLAG, IE5 IE4 IE3 IE2 XT/RG RGMD RGSL -
sfr P4     = 0xA5; // PORT 4, - - - - P4.3 P4.2 P4.1 P4.0

sfr SADDR  = 0xA9; // SLAVE ADDRESS, The SADDR should be programmed to the given or broadcast address for serial port 0 to which the slave processor is designated.
sfr SADDR1 = 0xAA; // SLAVE ADDRESS 1, The SADDR1 should be programmed to the given or broadcast address for serial port 1 to which the slave processor is designated.
sfr SADEN  = 0xB9; // SLAVE ADDRESS MASK ENABLE, This register enables the Automatic Address Recognition feature of the Serial port 0. When a bit in the SADEN is set to 1, the same bit location in SADDR will be compared with the incoming serial data. When SADEN.n is 0, then the bit becomes a "don't care" in the comparison. This register enables the Automatic Address Recognition feature of the Serial port 0. When all the bits of SADEN are 0, interrupt will occur for any incoming address.
sfr SADEN1 = 0xBA; // SLAVE ADDRESS MASK ENABLE 1, This register enables the Automatic Address Recognition feature of the Serial port 1. When a bit in the SADEN1 is set to 1, the same bit location in SADDR1 will be compared with the incoming serial data. When SADEN1.n is 0, then the bit becomes a "don't care" in the comparison. This register enables the Automatic Address Recognition feature of the Serial port 1. When all the bits of SADEN1 are 0, interrupt will occur for any incoming address.
sfr SCON1  = 0xC0; // SERIAL PORT CONTROL 1, SM0_1/FE_1 SM1_1 SM2_1 REN_1 TB8_1 RB8_1 TI_1 RI_1
sfr SBUF1  = 0xC1; // SERIAL DATA BUFFER 1, SBUF1.7 SBUF1.6 SBUF1.5 SBUF1.4 SBUF1.3 SBUF1.2 SBUF1.1 SBUF1.0
sfr ROMMAP = 0xC2; // ROMMAP, WS 1 - - - - - -
sfr PMR    = 0xC4; // POWER MANAGEMENT REGISTER, CD1 CD0 SWB - XTOFF ALE-OFF - DME0
sfr STATUS = 0xC5; // STATUS REGISTER, - HIP LIP XTUP SPTA1 SPRA1 SPTA0 SPRA0
sfr TA     = 0xC7; // TIMED ACCESS, TA.7 TA.6 TA.5 TA.4 TA.3 TA.2 TA.1 TA.0
sfr WDCON  = 0xD8; // WATCHDOG CONTROL, SMOD_1 POR - - WDIF WTRF EWT RWT
sfr EIE    = 0xE8; // EXTENDED INTERRUPT ENABLE, - - - EWDI EX5 EX4 EX3 EX2
sfr EIP    = 0xF8; // EXTENDED INTERRUPT PRIORITY, - - - PWDI PX5 PX4 PX3 PX2

///////////////////
// BIT Registers //
///////////////////

// P0: PORT 0, P0.7 P0.6 P0.5 P0.4 P0.3 P0.2 P0.1 P0.0
sbit P0_7  = P0^7;
sbit P0_6  = P0^6;
sbit P0_5  = P0^5;
sbit P0_4  = P0^4;
sbit P0_3  = P0^3;
sbit P0_2  = P0^2;
sbit P0_1  = P0^1;
sbit P0_0  = P0^0;

/*
// SP: STACK POINTER, SP.7 SP.6 SP.5 SP.4 SP.3 SP.2 SP.1 SP.0
sbit SP_7  = SP^7;
sbit SP_6  = SP^6;
sbit SP_5  = SP^5;
sbit SP_4  = SP^4;
sbit SP_3  = SP^3;
sbit SP_2  = SP^2;
sbit SP_1  = SP^1;
sbit SP_0  = SP^0;
*/

/*
// DPL: DATA POINTER LOW, DPL.7 DPL.6 DPL.5 DPL.4 DPL.3 DPL.2 DPL.1 DPL.0
sbit DPL_7 = DPL^7;
sbit DPL_6 = DPL^6;
sbit DPL_5 = DPL^5;
sbit DPL_4 = DPL^4;
sbit DPL_3 = DPL^3;
sbit DPL_2 = DPL^2;
sbit DPL_1 = DPL^1;
sbit DPL_0 = DPL^0;
*/

/*
// DPH: DATA POINTER HIGH, DPH.7 DPH.6 DPH.5 DPH.4 DPH.3 DPH.2 DPH.1 DPH.0
sbit DPH_7 = DPH^7;
sbit DPH_6 = DPH^6;
sbit DPH_5 = DPH^5;
sbit DPH_4 = DPH^4;
sbit DPH_3 = DPH^3;
sbit DPH_2 = DPH^2;
sbit DPH_1 = DPH^1;
sbit DPH_0 = DPH^0;
*/

/*
// PCON: POWER CONTROL, SM0D SMOD0 - - GF1 GF0 PD IDL
sbit SM0D  = PCON^7; // This bit doubles the serial port baud rate in mode 1, 2, and 3 when set to 1.
sbit SMOD0 = PCON^6; // Framing Error Detection Enable: When SMOD0 is set to 1, then SCON.7(SCON1.7) indicates a Frame Error and acts as the FE(FE_1) flag. When SMOD0 is 0, then SCON.7(SCON1.7) acts as per the standard 8052 function.
sbit GF1   = PCON^3; // These two bits are general purpose user flags.
sbit GF0   = PCON^2; // These two bits are general purpose user flags.
sbit PD    = PCON^1; // Setting this bit causes the W77E58 to go into the POWER DOWN mode. In this mode all the clocks are stopped and program execution is frozen.
sbit IDL   = PCON^0; // Setting this bit causes the W77E58 to go into the IDLE mode. In this mode the clocks to the CPU are stopped, so program execution is frozen. But the clock to the serial, timer and interrupt blocks is not stopped, and these blocks continue operating.
*/

// TCON: TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0
sbit TF1   = TCON^7; // Timer 1 overflow flag: This bit is set when Timer 1 overflows. It is cleared automatically when the program does a timer 1 interrupt service routine. Software can also set or clear this bit.
sbit TR1   = TCON^6; // Timer 1 run control: This bit is set or cleared by software to turn timer/counter on or off.
sbit TF0   = TCON^5; // Timer 0 overflow flag: This bit is set when Timer 0 overflows. It is cleared automatically when the program does a timer 0 interrupt service routine. Software can also set or clear this bit.
sbit TR0   = TCON^4; // Timer 0 run control: This bit is set or cleared by software to turn timer/counter on or off.
sbit IE1   = TCON^3; // Interrupt 1 edge detect: Set by hardware when an edge/level is detected on INT1. This bit is cleared by hardware when the service routine is vectored to only if the interrupt was edge triggered. Otherwise it follows the pin.
sbit IT1   = TCON^2; // Interrupt 1 type control: Set/cleared by software to specify falling edge/ low level triggered external inputs.
sbit IE0   = TCON^1; // Interrupt 0 edge detect: Set by hardware when an edge/level is detected on INT0 . This bit is cleared by hardware when the service routine is vectored to only if the interrupt was edge triggered. Otherwise it follows the pin.
sbit IT0   = TCON^0; // Interrupt 0 type control: Set/cleared by software to specify falling edge/ low level triggered external inputs.

/*
// TMOD: TIMER MODE CONTROL, GATE C/T M1 M0 GATE C/T M1 M0
sbit T1_GATE  = TMOD^7; // Gating control: When this bit is set, Timer/counter x is enabled only while INTx pin is high and TRx control bit is set. When cleared, Timer x is enabled whenever TRx control bit is set.
sbit T1_CT    = TMOD^6; // Timer or Counter Select: When cleared, the timer is incremented by internal clocks. When set, the timer counts high-to-low edges of the Tx pin.
sbit T1_M1    = TMOD^5; // M1, M0: Mode Select bits: 
sbit T1_M0    = TMOD^4; // M1 M0 Mode
						// 0  0  Mode 0: 8-bits with 5-bit prescale.
						// 0  1  Mode 1: 18-bits, no prescale.
						// 1  0  Mode 2: 8-bits with auto-reload from THx
						// 1  1  Mode 3: (Timer 0) TL0 is an 8-bit timer/counter controlled by the standard Timer 0
						// control bits. TH0 is a 8-bit timer only controlled by Timer 1 control bits. (Timer 1) Timer/counter is stopped.
sbit T0_GATE  = TMOD^3; // Gating control: When this bit is set, Timer/counter x is enabled only while INTx pin is high and TRx control bit is set. When cleared, Timer x is enabled whenever TRx control bit is set.
sbit T0_CT    = TMOD^2; // Timer or Counter Select: When cleared, the timer is incremented by internal clocks. When set, the timer counts high-to-low edges of the Tx pin.
sbit T0_M1    = TMOD^1; // M1, M0: Mode Select bits: 
sbit T0_M0    = TMOD^0; // M1 M0 Mode
						// 0  0  Mode 0: 8-bits with 5-bit prescale.
						// 0  1  Mode 1: 18-bits, no prescale.
						// 1  0  Mode 2: 8-bits with auto-reload from THx
						// 1  1  Mode 3: (Timer 0) TL0 is an 8-bit timer/counter controlled by the standard Timer 0
						// control bits. TH0 is a 8-bit timer only controlled by Timer 1 control bits. (Timer 1) Timer/counter is stopped.
*/

/*					
// TL0: TIMER 0 LSB, TL0.7 TL0.6 TL0.5 TL0.4 TL0.3 TL0.2 TL0.1 TL0.0
sbit TL0_7     = TL0^7;
sbit TL0_6     = TL0^6;
sbit TL0_5     = TL0^5;
sbit TL0_4     = TL0^4;
sbit TL0_3     = TL0^3;
sbit TL0_2     = TL0^2;
sbit TL0_1     = TL0^1;
sbit TL0_0     = TL0^0;
*/

/*
// TL1: TIMER 1 LSB, TL1.7 TL1.6 TL1.5 TL1.4 TL1.3 TL1.2 TL1.1 TL1.0
sbit TL1_7     = TL1^7;
sbit TL1_6     = TL1^6;
sbit TL1_5     = TL1^5;
sbit TL1_4     = TL1^4;
sbit TL1_3     = TL1^3;
sbit TL1_2     = TL1^2;
sbit TL1_1     = TL1^1;
sbit TL1_0     = TL1^0;
*/

/*
// TH0: TIMER 0 MSB, TH0.7 TH0.6 TH0.5 TH0.4 TH0.3 TH0.2 TH0.1 TH0.0
sbit TH0_7     = TH0^7;
sbit TH0_6     = TH0^6;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一个色综合av| 欧美专区日韩专区| 国产精品18久久久久| 麻豆91精品视频| 图片区小说区区亚洲影院| 亚洲超碰精品一区二区| 午夜精品福利一区二区三区av| 亚洲制服丝袜一区| 午夜久久久影院| 丝袜亚洲精品中文字幕一区| 日韩激情av在线| 看国产成人h片视频| 久久国产欧美日韩精品| 国产一区二区三区最好精华液| 国内外精品视频| 成人午夜看片网址| 99久久国产综合精品色伊| 色老综合老女人久久久| 欧美精品一级二级| 欧美一级一区二区| 久久久噜噜噜久久人人看| 亚洲国产精品成人久久综合一区 | 国产精品久久看| 中文字幕在线播放不卡一区| 夜夜揉揉日日人人青青一国产精品| 高清不卡一二三区| 成人av片在线观看| 在线视频亚洲一区| 日韩欧美国产系列| 欧美国产成人精品| 亚洲成人资源在线| 九九久久精品视频| 国产传媒一区在线| 色噜噜狠狠色综合中国| 91精品国产乱码久久蜜臀| 久久午夜羞羞影院免费观看| 国产精品国产三级国产a| 亚洲成人综合网站| 激情综合网av| 97久久人人超碰| 欧美精品欧美精品系列| 国产网红主播福利一区二区| 一区二区三区在线免费播放 | 99精品国产热久久91蜜凸| 欧美日韩三级一区| 久久久午夜精品理论片中文字幕| 亚洲免费在线播放| 久久 天天综合| 色综合久久综合| 精品国产乱码久久久久久久久| 国产精品日韩成人| 日精品一区二区| 成人av片在线观看| 91精品国产综合久久精品| 欧美高清在线一区| 亚洲国产日日夜夜| 国产成人日日夜夜| 亚洲午夜一区二区三区| 国产一区二区三区久久久 | 久久精品亚洲乱码伦伦中文 | 一区二区三区久久| 国产一区二区调教| 欧美日韩国产精品自在自线| 国产欧美一区二区在线观看| 亚洲午夜激情网页| 不卡一区二区三区四区| 日韩欧美你懂的| 亚洲综合一二区| 国产suv精品一区二区883| 日韩一区二区精品在线观看| 亚洲欧美偷拍三级| 国产福利一区二区三区| 欧美电影影音先锋| 一区二区三区中文字幕电影| 国产福利91精品一区| 欧美一级xxx| 亚洲一区在线视频观看| 本田岬高潮一区二区三区| 欧美电视剧免费观看| 亚洲第一主播视频| 一本到一区二区三区| 中文字幕国产一区二区| 欧美成人综合网站| 亚洲成av人片在线| 色婷婷精品久久二区二区蜜臂av| 国产午夜精品一区二区 | 欧美一区二区三区系列电影| 亚洲一区二区3| 91麻豆高清视频| 中文字幕欧美一| 国产成人精品亚洲日本在线桃色 | 在线区一区二视频| 自拍偷拍亚洲激情| 成人福利视频网站| 国产欧美日韩麻豆91| 国产精品影音先锋| 欧美激情综合网| 国产老女人精品毛片久久| 精品国产乱码久久久久久久久 | 福利一区福利二区| 久久久久久一级片| 国产丶欧美丶日本不卡视频| www激情久久| 国产麻豆9l精品三级站| www国产成人免费观看视频 深夜成人网| 日韩成人免费电影| 日韩欧美高清在线| 精品一区二区久久久| 久久久综合九色合综国产精品| 经典一区二区三区| 久久精品亚洲精品国产欧美| 国产精品亚洲第一| 中文字幕电影一区| av毛片久久久久**hd| 亚洲人吸女人奶水| 在线观看成人免费视频| 亚洲成人午夜影院| 91精品国产综合久久福利| 青青草原综合久久大伊人精品| 亚洲制服丝袜在线| 欧美理论电影在线| 免费不卡在线视频| 久久免费的精品国产v∧| 国产精品亚洲а∨天堂免在线| 中文字幕欧美日本乱码一线二线| 成人免费看黄yyy456| 樱桃视频在线观看一区| 欧美日韩国产精品自在自线| 六月丁香婷婷久久| 国产三级一区二区三区| 97精品久久久久中文字幕 | 国产精一品亚洲二区在线视频| 国产女人18毛片水真多成人如厕 | 成人国产亚洲欧美成人综合网| 亚洲欧洲日韩一区二区三区| 色伊人久久综合中文字幕| 风间由美一区二区av101| 26uuu亚洲| 91小宝寻花一区二区三区| 亚洲高清免费一级二级三级| 欧美videos大乳护士334| 国产毛片精品视频| 亚洲精品水蜜桃| 91精品欧美综合在线观看最新| 国产中文字幕精品| 一区二区三区精品视频在线| 日韩欧美激情一区| 99久久久久免费精品国产| 午夜国产不卡在线观看视频| 久久麻豆一区二区| 欧美视频自拍偷拍| 国产在线看一区| 夜夜精品浪潮av一区二区三区| 日韩精品中午字幕| 91在线丨porny丨国产| 琪琪一区二区三区| 18涩涩午夜精品.www| 欧美一区二区三区视频免费播放| 粉嫩aⅴ一区二区三区四区五区 | 国产白丝精品91爽爽久久| 亚洲国产毛片aaaaa无费看 | 亚洲男人的天堂网| 欧美大肚乱孕交hd孕妇| 色婷婷国产精品久久包臀| 国内精品自线一区二区三区视频| 亚洲一区视频在线观看视频| 国产午夜精品美女毛片视频| 91麻豆精品国产自产在线观看一区| 成人精品小蝌蚪| 久久国产免费看| 亚洲成人激情av| 亚洲欧美视频在线观看| 欧美mv日韩mv国产网站app| 在线免费观看日韩欧美| 成人夜色视频网站在线观看| 久久机这里只有精品| 亚洲高清视频在线| 亚洲色图制服丝袜| 国产欧美日韩在线视频| 日韩一级黄色大片| 精品视频在线看| 91蝌蚪porny成人天涯| 国产成人精品免费视频网站| 久久国产人妖系列| 日韩中文字幕亚洲一区二区va在线 | fc2成人免费人成在线观看播放| 捆绑调教美女网站视频一区| 亚洲国产中文字幕| 亚洲欧洲一区二区在线播放| 精品国产精品网麻豆系列| 91精品婷婷国产综合久久性色| 91啪九色porn原创视频在线观看| 国产乱码精品一区二区三区五月婷 | 日韩和的一区二区| 亚洲一区二区三区四区的| 亚洲免费观看高清完整版在线 | 国产原创一区二区| 免费久久99精品国产| 日韩国产欧美三级| 亚洲福利国产精品|