




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上Chip STC12C5204AD I/O port configurationSTC12C5204AD series microcontroller its all I/O ports are controlled by the software configuration into 4 kinds of work type 4 types are respectively: quasi two-way mouth (standard the 8051 output mode), push-pull output, only for input (high resi
2、stance) or open-drain output functions. Every mouth consists of two control register the relevant position control each pin type of work. STC12C5204AD series microcontroller to electricity reattachment shall prevail two-way mouth (standard the 8051 output mode) mode: 2V above high level, 0.8 V for l
3、ow level below.1. Quasi two-way mouth output configurationQuasi two-way mouth output type can be used as output and input function but don't need to reconfigure mouth lines output state. This is because juncture lines output is 1 drive ability is very weak, allowing external devices will its dow
4、n. When pins for low, it output driving ability, can absorb the considerable current. Quasi two-way mouth have 3 pull_up transistor adapted to different needs.In the three and one transistor, pull up transistor called weak on pull ", for 1 and paternal line registers itself pins for 1 open. Thi
5、s pull_up provides basic drive current make prospective two-way mouth for 1 output. If a pin for 1 and output by external devices to drop down to low, pull up close and weak "very weak pull_up" maintain open position, in order to put this pin for low, strong to pull the external devices mu
6、st have enough power to make pin infused current threshold voltage of a voltage to the following.Article 2 pull_up transistors, called "extremely weak on pull", 1 latch paternal line when open. When pin, the very weak suspended the pull_up source generates very weak and current will pin an
7、d high level.Article 3 pull_up transistor called "powerful pull". Juncture line latches from 0 to 1, the jumping to accelerate must pull up by logic 0 to two-way mouth logic 1 conversion. When this happened, powerful pull open about 2 machine cycle to make pins can quickly pull to the eart
8、h high level.Quasi two-way mouth output shown below.STC12C520 series microcontroller 3V device, if the user is in pins plus 5V voltage, there will be a current flow from pins, this has caused additional VDD power consumption. Accordingly, the proposal is not in quasi two-way mouth mode 3V microcontr
9、oller pins to exert 5V voltage, such as the use of words, will add current limiting resistor, or using diode do input isolation, or use triode do output segregation.Quasi two-way mouth with a schmidt trigger input and a interference suppression circuit.2. The push-pull output configurationThe drop-d
10、own push-pull output configuration open-drain output and the structure and the prospective two-way mouth down same structure, but when latches is 1 provides continuous strong pull up. The push-pull model need more commonly used for driving current situation.The push-pull pins configuration are shown
11、 below.3. Only for input (high resistance) configurationInput port configuration are shown below.Input port with a schmidt trigger input and a interference suppression circuit.4. Open-drain output configurationJuncture line latches is 0, the open-drain output close all pull_up transistors. When, as
12、a logical output, this configuration mode must have externally pull, usually by resistance receiving V D D outside. This style of drop-down and quasi two-way mouth the same. The jammer line configuration are shown below.Open-drain port with a schmidt trigger input and a interference suppression circ
13、uit.A typical transistor control circuitIf use weak pull_up control, suggestion plus pull-up resistors R1 (3.3 K 10K), if not add pull-up resistors R 1 (3.3 K 10K), suggest R2 value in the 15K above, or use a strong push-pull output.STC12C5204AD series microcontroller programmable counter array (PCA
14、)PCA contains a special 16 timer, has four 16 bits of capture/comparison of module and connected. Each module programmable workIn four mode: increase/decrease along the capture, software timer, high-speed output or could be modulated pulse output. Modules connected to P3.7 (0 CEX0 / PCA0 / PWM0), mo
15、dule 1 connected to P3.5 (CEX1 / PCA1 / PWM1), modules connected to P2.0 (2 CEX2 / PCA2 / PWM2), modules connected to P2.4 (3 CEX3 / PCA3 / PWM3). Register the content of CH and CL is free of 16 PCA increasing count the value of the timer. PCA timer is four modules, the public time benchmark by prog
16、ramming work .Programmable Counter ArrayPCA Timer/CounterCMOD SFR there are 2 bytes and PCA related. They were: CIDL, idle mode allows stop PCA; ECF, buy a, enabling PCA interrupt, when PCA timer spillover will PCA counting overflow marks CCON SFR (CF) buy bits.CCON SFR contains PCA operating contro
17、l bits (CR) and PCA timer mark (CF) and symbol of each module CCF3 / CCF2 (CCF0). CCF1 / / Through the software for a CR bits (CCON. 6) to run PCA. CR bit is reset when PCA closed. When PCA counter overflow, CF patients (CCON. 7) buy a, if CMOD register, it produces ECF position a disruption. CF bit
18、s can only through software cleared. CCON register a 0 3 is PCA modules logo (a 0 0, a corresponding module 1 corresponding module 1, bits 2 corresponding module 2, a 3 corresponding module 3), when there is a match or by hardware buy a comparisons. These signals are the only through software cleare
19、d.PCA capture of patterningIf CCON SFR bits of the throne of CCFn and CCAPMn SFR ECCFn bit is set position, will produce the interruption.A software timer modeThrough the CCAPMn registers for a ECOM and MAT bits, can make the PCA module used for software timer (below). PCA timer values and module of
20、 the register compared to capture, when both values equal, if a CCON SFR in CCFn (in) and a ECCFn CCAPMn SFR) in all buy bits, will produce the interruption.PCA Software Timer Mode/Software Timer model/PCA comparative ModePCA Software Timer Mode/Software Timer model/PCA comparative ModeHigh-speed ou
21、tput modelThis model (below), when PCA counter plan of the numerical and module capture registers matching, PCA value CEXn output will happen module of the flip. To activate the high-speed output modes of CCAPMn TOG SFR, modules, MAT and ECOM bit must buy bits.PCA High - Speed, Output Mode/PCA high-
22、speed Output ModeIn use PCA high-speed output mode special application note:If a certain PCA module working in high speed pulse output mode, want to use software output change the same group of other common I/O port state, need to do first, whether CCAPnH judge CH is equal to abide, can freely modif
23、y, if equal, and determine CCAPnL circumstances > CL is allowed to change the same group of other common I/O port state. If use P3.7 / PCA0 / PWM0 do PCA high-speed pulse output, and the program inside and with software output change when the state P3.4 mouth, you need to do judgment.When one has
24、 the PCA high-speed pulse output function of I/O mouth working in high speed pulse output mode, if the software for the same group of other I/O port operation, if meet PCA comparator matching, this operation can change the pulse output function with PCA high-speed mouth of the I/O.PCA PWM mode/modul
25、ation pulse width output modeSince all share only PCA timer modules, all their output frequency is same. The output of each module 390v is independent of the changes, and using EPCnL, captured CCAPnL of registers concerned. When CL SFR value is less than CCAPnL EPCnL, when output is low, and the val
26、ue of SFR when PCA CL is equal to or greater than EPCnL, CCAPnL , the output as high. When the value of the CL by FF into EPCnH, 00 overflow, CCAPnH the contents of EPCnL, loaded into the CCAPnL . In this way, can realize update PWM without interference. To make CCAPMn PWM mode, module can PWMn and
27、ECOMn bits of the register to buy bits.譯文芯片STC12C5204AD的I/O口配置STC12C5204AD系列單片機(jī)其所有I/O口均可由軟件配置成4 種工作類型4 種類型分別為:準(zhǔn)雙向口(標(biāo)準(zhǔn)8051輸出模式)、推挽輸出、僅為輸入(高阻)或開(kāi)漏輸出功能。每個(gè)口由2個(gè)控制寄存器中的相應(yīng)位控制每個(gè)引腳工作類型。STC12C5204AD系列單片機(jī)上電復(fù)位后為準(zhǔn)雙向口(標(biāo)準(zhǔn)8051輸出模式)模式:2V 以上時(shí)為高電平,0.8V 以下時(shí)為低電平。1.準(zhǔn)雙向口輸出配置準(zhǔn)雙向口輸出類型可用作輸出和輸入功能而不需重新配置口線輸出狀態(tài)。這是因?yàn)楫?dāng)口線輸出為1時(shí)驅(qū)動(dòng)能力很
28、弱,允許外部裝置將其拉低。當(dāng)引腳輸出為低時(shí),它的驅(qū)動(dòng)能力很強(qiáng),可吸收相當(dāng)大的電流。準(zhǔn)雙向口有3個(gè)上拉晶體管適應(yīng)不同的需要。在3個(gè)上拉晶體管中,有1個(gè)上拉晶體管稱為“弱上拉”,當(dāng)口線寄存器為1且引腳本身也為1時(shí)打開(kāi)。此上拉提供基本驅(qū)動(dòng)電流使準(zhǔn)雙向口輸出為1。如果一個(gè)引腳輸出為1而由外部裝置下拉到低時(shí),弱上拉關(guān)閉而“極弱上拉”維持開(kāi)狀態(tài),為了把這個(gè)引腳強(qiáng)拉為低,外部裝置必須有足夠的灌電流能力使引腳上的電壓降到門檻電壓以下。第2個(gè)上拉晶體管,稱為“極弱上拉”,當(dāng)口線鎖存為1 時(shí)打開(kāi)。當(dāng)引腳懸空時(shí),這個(gè)極弱的上拉源產(chǎn)生很弱的上拉電流將引腳上拉為高電平。第3個(gè)上拉晶體管稱為“強(qiáng)上拉”。當(dāng)口線鎖存器由0到
29、1跳變時(shí),這個(gè)上拉用來(lái)加快準(zhǔn)雙向口由邏輯0到邏輯1轉(zhuǎn)換。當(dāng)發(fā)生這種情況時(shí),強(qiáng)上拉打開(kāi)約2個(gè)機(jī)器周期以使引腳能夠迅速地上拉到高電平。準(zhǔn)雙向口輸出如下圖所示。STC12C520系列單片機(jī)為3V器件,如果用戶在引腳加上5V電壓,將會(huì)有電流從引腳流向VDD,這樣導(dǎo)致額外的功率消耗。因此,建議不要在準(zhǔn)雙向口模式中向3V 單片機(jī)引腳施加5V電壓,如使用的話,要加限流電阻,或用二極管做輸入隔離,或用三極管做輸出隔離。準(zhǔn)雙向口帶有一個(gè)施密特觸發(fā)輸入以及一個(gè)干擾抑制電路。2 .推挽輸出配置推挽輸出配置的下拉結(jié)構(gòu)與開(kāi)漏輸出以及準(zhǔn)雙向口的下拉結(jié)構(gòu)相同,但當(dāng)鎖存器為1時(shí)提供持續(xù)的強(qiáng)上拉。推挽模式一般用于需要更大驅(qū)動(dòng)電
30、流的情況。推挽引腳配置如下圖所示。3 .僅為輸入(高阻)配置輸入口配置如下圖所示。輸入口帶有一個(gè)施密特觸發(fā)輸入以及一個(gè)干擾抑制電路。4.開(kāi)漏輸出配置當(dāng)口線鎖存器為0時(shí),開(kāi)漏輸出關(guān)閉所有上拉晶體管。當(dāng)作為一個(gè)邏輯輸出時(shí),這種配置方式必須有外部上拉,一般通過(guò)電阻外接到V D D 。這種方式的下拉與準(zhǔn)雙向口相同。輸出口線配置如下圖所示。開(kāi)漏端口帶有一個(gè)施密特觸發(fā)輸入以及一個(gè)干擾抑制電路。一種典型三極管控制電路如果用弱上拉控制,建議加上拉電阻R1(3.3K10K),如果不加上拉電阻R 1(3.3K10K),建議R2的值在15K以上,或用強(qiáng)推挽輸出。STC12C5204AD系列單片機(jī)可編程計(jì)數(shù)器陣列(P
31、CA)PCA含有一個(gè)特殊的16位定時(shí)器,有4個(gè)16位的捕獲/比較模塊與之相連。每個(gè)模塊可編程工作。在4 種模式下:上升/下降沿捕獲、軟件定時(shí)器、高速輸出或可調(diào)制脈沖輸出。模塊0連接到P3.7(CEX0/PCA0/PWM0),模塊1連接到P3.5(CEX1/PCA1/PWM1),模塊2連接到P2.0(CEX2/PCA2/PWM2),模塊3連接到P2.4(CEX3/PCA3/PWM3)。寄存器CH和CL的內(nèi)容是正在自由遞增計(jì)數(shù)的16位PCA 定時(shí)器的值。PCA定時(shí)器是4個(gè)模塊的公共時(shí)間基準(zhǔn),可通過(guò)編程工作在:1/12振蕩頻率、1/2振蕩頻率、定時(shí)器0溢出或ECI腳的輸入(P3.4)。定時(shí)器的計(jì)數(shù)源
32、由CMOD SFR 的CPS1和CPS0位來(lái)確定(見(jiàn)CMOD特殊功能寄存器說(shuō)明)。可編程計(jì)數(shù)器陣列PCA定時(shí)器/計(jì)數(shù)器CMOD SFR 還有2個(gè)位與PCA相關(guān)。它們分別是:CIDL,空閑模式下允許停止PCA;ECF,置位時(shí),使能PCA中斷,當(dāng)PCA定時(shí)器溢出將PCA計(jì)數(shù)溢出標(biāo)志CF(CCON SFR)置位。CCON SFR包含PCA的運(yùn)行控制位(CR)和PCA定時(shí)器標(biāo)志(CF)以及各個(gè)模塊的標(biāo)志(CCF3/CCF2/CCF1/CCF0)。通過(guò)軟件置位CR 位(CCON.6)來(lái)運(yùn)行PCA。CR位被清零時(shí)PCA關(guān)閉。當(dāng)PCA計(jì)數(shù)器溢出時(shí),CF位(CCON.7)置位, 如果CMOD寄存器的ECF位置
33、位, 就產(chǎn)生中斷。CF位只可通過(guò)軟件清除。CCON 寄存器的位03是PCA各個(gè)模塊的標(biāo)志(位0對(duì)應(yīng)模塊0,位1對(duì)應(yīng)模塊1,位2對(duì)應(yīng)模塊2,位3 對(duì)應(yīng)模塊3),當(dāng)發(fā)生匹配或比較時(shí)由硬件置位。這些標(biāo)志也只能通過(guò)軟件清除。所有模塊共用一個(gè)中斷向量。PCA的中斷系統(tǒng)如圖所示。PCA的每個(gè)模塊都對(duì)應(yīng)一個(gè)特殊功能寄存器。它們分別是:模塊0對(duì)應(yīng)CCAPM0,模塊1對(duì)應(yīng)CCAPM1,模塊2對(duì)應(yīng)CCAPM2,模塊3對(duì)應(yīng)CCAPM3。特殊功能寄存器包含了相應(yīng)模塊的工作模式控制位。當(dāng)模塊發(fā)生匹配或比較時(shí),ECCFn位(CCAPMn.0,n0,1 ,2,3 由工作的模塊決定)使能CCON SFR的CCFn標(biāo)志來(lái)產(chǎn)生中
34、斷。PWM(CCAPMn.1)用來(lái)使能脈寬調(diào)制模式。當(dāng)PCA計(jì)數(shù)值與模塊的捕獲/比較寄存器的值相匹配時(shí),如果TOG位(CCAPMn.2)置位,模塊的CEXn 輸出將發(fā)生翻轉(zhuǎn)。當(dāng)PCA計(jì)數(shù)值與模塊的捕獲/比較寄存器的值相匹配時(shí),如果匹配位MATn(CCAPMn.3)置位,CCON 寄存器的CCFn位將被置位。CAPNn(CCAPMn.4)和CAPPn(CCAPMn.5)用來(lái)設(shè)置捕獲輸入的有效沿。CAPNn位使能下降沿有效,CAPPn位使能上升沿有效。如果兩位都置位,則兩種跳變沿都被使能,捕獲可在兩種跳變沿產(chǎn)生。通過(guò)置位CCAPMn寄存器的ECOMn位(CCAPMn.6)來(lái)使能比較器功能。每個(gè)PCA模塊還對(duì)應(yīng)另外兩個(gè)寄存器,CCAPnH和CCAPnL。當(dāng)出現(xiàn)捕獲或比較時(shí),它們用來(lái)保存16位的計(jì)數(shù)值。當(dāng)PCA模塊用在PWM模式中時(shí),它們用來(lái)控制輸出的占空比。PCA捕獲模式要使一個(gè)PCA模塊工作在捕獲模式(下圖),寄存器CCAPMn的兩位(CAPNn 和CAPPn)或其中任何一位必須置1。對(duì)模塊的外部CEXn 輸入(CEX0/P3.7,CEX1/P3.5,CEX2/P2.0,CEX3/
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 鐵路職稱體系建設(shè)方案(3篇)
- 街道企業(yè)分工方案模板(3篇)
- 2025年度智能駕駛技術(shù)研發(fā)與應(yīng)用合作協(xié)議
- 2025年度航空航天系統(tǒng)集成項(xiàng)目合同規(guī)范與執(zhí)行要求
- 2025年室內(nèi)裝飾設(shè)計(jì)師(中級(jí))考試試卷:傳統(tǒng)中式風(fēng)格設(shè)計(jì)理念
- 2025年西班牙語(yǔ)DELEFF級(jí)閱讀訓(xùn)練試題
- 以科技助力辦公效率-數(shù)據(jù)分析與技術(shù)支持研究
- 智能黑板在課堂教學(xué)中的使用體驗(yàn)
- 商業(yè)環(huán)境中的員工行為分析與改進(jìn)
- 2024年四川省監(jiān)獄管理局下屬事業(yè)單位考試真題
- 公共浴池水質(zhì)標(biāo)準(zhǔn)
- GA/T 2133.1-2024便攜式微型計(jì)算機(jī)移動(dòng)警務(wù)終端第1部分:技術(shù)要求
- 農(nóng)藥使用管理制度
- 班組長(zhǎng)成本績(jī)效管理能力考試題庫(kù)-下(判斷題)
- 呼吸機(jī)斷電的應(yīng)急演練
- 視覺(jué)傳達(dá)設(shè)計(jì)保研面試問(wèn)題
- 慰問(wèn)品采購(gòu)項(xiàng)目供貨方案
- 醫(yī)院護(hù)理培訓(xùn)課件:《注射安全》
- 5G智慧執(zhí)法解決方案
- 2024年南寧鐵路局招聘筆試參考題庫(kù)附帶答案詳解
- (完整)中醫(yī)癥候積分量表
評(píng)論
0/150
提交評(píng)論