【正文】
type can be used as output and input function but don39。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 down. When pins for low, it output driving ability, can absorb the considerable current. Quasi twoway 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. This pull_up provides basic drive current make prospective twoway 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 must 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 and 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 twoway mouth logic 1 conversion. When this happened, powerful pull open about 2 machine cycle to make pins can quickly pull to the earth high level. Quasi twoway mouth output shown below. 石家莊鐵道大學(xué)四方學(xué)院 24 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 twoway mouth mode 3V microcontroller 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 twoway mouth with a schmidt trigger input and a interference suppression circuit. 2. The pushpull output configuration The dropdown pushpull output configuration opendrain output and the structure and the prospective twoway mouth down same structure, but when latches is 1 provides continuous strong pull up. The pushpull model need more monly used for driving current situation. The pushpull pins configuration are shown below. 石家莊鐵道大學(xué)四方學(xué)院 25 3. Only for input (high resistance) configuration Input port configuration are shown below. Input port with a schmidt trigger input and a interference suppression circuit. 4. Opendrain output configuration Juncture line latches is 0, the opendrain output close all pull_up transistors. When, as a logical output, this configuration mode must have externally pull, usually by resistance receiving V D D outside. This style of dropdown and quasi twoway mouth the same. The jammer line configuration are shown below. Opendrain port with a schmidt trigger input and a interference suppression circuit. A typical transistor control circuit 石家莊鐵道大學(xué)四方學(xué)院 26 If use weak pull_up control, suggestion plus pullup resistors R1 ( K ~ 10K), if not add pullup resistors R 1 ( K ~ 10K), suggest R2 value in the 15K above, or use a strong pushpull output. STC12C5204AD series microcontroller programmable counter array (PCA) PCA contains a special 16 timer, has four 16 bits of capture/parison of module and connected. Each module programmable work In four mode: increase/decrease along the capture, software timer, highspeed output or could be modulated pulse output. Modules connected to (0 CEX0 / PCA0 / PWM0), module 1 connected to (CEX1 / PCA1 / PWM1), modules connected to (2 CEX2 / PCA2 / PWM2), modules connected to (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 programming work . Programmable Counter Array 石家莊鐵道大學(xué)四方學(xué)院 27 PCA Timer/Counter CMOD 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 control 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 bits 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 parisons. These signals are the only through software cleared. 石家莊鐵道大學(xué)四方學(xué)院 28 PCA capture of patterning If CCON SFR bits of the throne of CCFn and CCAPMn SFR ECCFn bit is set position, will produce the interruption. A software timer mode Through 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 the register pared 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 parative Mode PCA Software Timer Mode/Software Timer model/PCA parative Mode 石家莊鐵道大學(xué)四方學(xué)院 29 Highspeed output model This 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 highspeed output modes of CCAPMn TOG SFR, modules, MAT and ECOM bit must buy bits. PCA High Speed, Output Mode/PCA highspeed Output Mode In use PCA highspeed output