Download Print this page

Read The User-Defined Internal Irc Frequency (Read From Ram) - STC micro STC8A8K64D4 Series Reference Manual

Advertisement

STC8A8K64D4 Series Manual

7.5.12 Read the User-defined internal IRC Frequency (Read from RAM)

C language code
//Operating frequency for test is 11.0592MHz
#include "reg51.h"
#include "intrins.h"
#define
CLKDIV
sfr
P_SW2
sfr
IRTRIM
sfr
P1M1
sfr
P1M0
sfr
P0M1
sfr
P0M0
sfr
P2M1
sfr
P2M0
sfr
P3M1
sfr
P3M0
sfr
P4M1
sfr
P4M0
sfr
P5M1
sfr
P5M0
char
*IRC22M;
char
*IRC24M;
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;
IRC22M = (char idata *)0xfa;
IRC24M = (char idata *) 0xfb;
//
IRCCR = *IRC22M;
IRCCR = *IRC24M;
P_SW2 = 0x80;
CLKDIV = 0;
P_SW2 = 0x00;
while (1);
}
Assembly code
;Operating frequency for test is 11.0592MHz
(*(unsigned char volatile xdata *)0xfe01)
=
0xba;
=
0x9f;
=
0x91;
=
0x92;
=
0x93;
=
0x94;
=
0x95;
=
0x96;
=
0xb1;
=
0xb2;
=
0xb3;
=
0xb4;
=
0xc9;
=
0xca;
//Load 22.1184MHz IRC parameters
//Load 24MHz IRC parameters
//No division to main clock
-
- 152 -

Advertisement

loading
Need help?

Need help?

Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin