| Electronic Components Datasheet Search |
|
STC12LE5616AD Datasheet(PDF) 259 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC12LE5616AD Datasheet(HTML) 259 Page - STCmicro Technology Co,.Ltd |
|
259 / 377 page ![]() 10.6 Programs for PCA module as 16-bit High Speed Output(C and ASM) There are two programs for PCA module as 16-bit High Speed Output, one wrriten in C language and the other in assembly language. 1. C code listing: ;/*--------------------------------------------------------------------------------------*/ ;/* --- STC MCU International Limited -----------------------------------------*/ ;/* --- STC 1T Series MCU PCA module as 16-bit High Speed Output ----*/ ;/* If you want to use the program or the program referenced in the */ ;/* article, please specify in which data and procedures from STC */ ;/*---------------------------------------------------------------------------------------*/ #include "reg51.h" #include "intrins.h" #define FOSC 18432000L #define T100KHz (FOSC / 4 / 100000) typedef unsigned char BYTE; typedef unsigned int WORD; /*Declare SFR associated with the PCA */ sbit EPCAI = IE^6; sfr CCON = 0xD8; //PCA control register sbit CCF0 = CCON^0; //PCA module-0 interrupt flag sbit CCF1 = CCON^1; //PCA module-1 interrupt flag sbit CR = CCON^6; //PCA timer run control bit sbit CF = CCON^7; //PCA timer overflow flag sfr CMOD = 0xD9; //PCA mode register sfr CL = 0xE9; //PCA base timer LOW sfr CH = 0xF9; //PCA base timer HIGH sfr CCAPM0 = 0xDA; //PCA module-0 mode register sfr CCAP0L = 0xEA; //PCA module-0 capture register LOW sfr CCAP0H = 0xFA; //PCA module-0 capture register HIGH sfr CCAPM1 = 0xDB; //PCA module-1 mode register sfr CCAP1L = 0xEB; //PCA module-1 capture register LOW sfr CCAP1H = 0xFB; //PCA module-1 capture register HIGH sfr CCAPM2 = 0xDC; //PCA module-2 mode register sfr CCAP2L = 0xEC; //PCA module-2 capture register LOW sfr CCAP2H = 0xFC; //PCA module-2 capture register HIGH sfr CCAPM3 = 0xDD; //PCA module-3 mode register sfr CCAP3L = 0xED; //PCA module-3 capture register LOW sfr CCAP3H = 0xFD; //PCA module-3 capture register HIGH 259 |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |