EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 556

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
- 540 -
sfr P3M0 = 0xb2;
sfr P4M1 = 0xb3;
sfr P4M0 = 0xb4;
sfr P5M1 = 0xc9;
sfr P5M0 = 0xca;
sbit P10 = P1^0;
void PCA_Isr() interrupt 7
{
CCF0 = 0;
P10 = !P10;
}
void main()
{
P0M0 = 0x00;
P0M1 = 0x00;
P1M0 = 0x00;
P1M1 = 0x00;
P2M0 = 0x00;
P2M1 = 0x00;
P3M0 = 0x00;
P3M1 = 0x00;
P4M0 = 0x00;
P4M1 = 0x00;
P5M0 = 0x00;
P5M1 = 0x00;
CCON = 0x00;
CMOD = 0x08; //PCA clock is the system clock
CL = 0x00;
CH = 0x00;
CCAPM0 = 0x11; //Extend external port CCP0 as a falling edge interrupt port
// CCAPM0 = 0x21; //Extend external port CCP0 as a rising edge interrupt port
// CCAPM0 = 0x31; //Extend external port CCP0 as a rising and falling edge interrupt port
CCAP0L = 0;
CCAP0H = 0;
CR = 1; //Start PCA timer
EA = 1;
while (1);
}
Assembly code
;Operating frequency for test is 11.0592MHz
CCON DATA 0D8H
CF BIT CCON.7
CR BIT CCON.6
CCF2 BIT CCON.2
CCF1 BIT CCON.1
CCF0 BIT CCON.0
CMOD DATA 0D9H
CL DATA 0E9H
CH DATA 0F9H
CCAPM0 DATA 0DAH

Table of Contents

Related product manuals