English
Language : 

AN131 Datasheet, PDF (11/16 Pages) Silicon Laboratories – The C8051F12x series is pin compatible
AN131
Example 2
//-----------------------------------------------------------------------------
// F12x_INIT_2.c
//-----------------------------------------------------------------------------
// Copyright 2002 Cygnal Integrated Products, Inc.
//
// AUTH: FB
// DATE: 19 SEP 02
//
// This file contains example initialization routines for the C8051F12x series
// of devices.
//
// This program uses a 22.1184 Mhz crystal oscillator multiplied by (9/4)
// for an effective SYSCLK of 49.7664 Mhz. This program also initializes and
// uses UART0 at <BAUDRATE> bits per second.
//
//
// Target: C8051F12x
// Tool chain: KEIL C51 6.03 / KEIL EVAL C51
//
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include <c8051f120.h>
// SFR declarations
#include <stdio.h>
// printf() and getchar()
//-----------------------------------------------------------------------------
// 16-bit SFR Definitions for 'F12x
//-----------------------------------------------------------------------------
sfr16 DP
sfr16 ADC0
sfr16 ADC0GT
sfr16 ADC0LT
sfr16 RCAP2
sfr16 RCAP3
sfr16 RCAP4
sfr16 TMR2
sfr16 TMR3
sfr16 TMR4
sfr16 DAC0
sfr16 DAC1
sfr16 PCA0CP5
sfr16 PCA0CP2
sfr16 PCA0CP3
sfr16 PCA0CP4
sfr16 PCA0
sfr16 PCA0CP0
sfr16 PCA0CP1
= 0x82;
= 0xbe;
= 0xc4;
= 0xc6;
= 0xca;
= 0xca;
= 0xca;
= 0xcc;
= 0xcc;
= 0xcc;
= 0xd2;
= 0xd2;
= 0xe1;
= 0xe9;
= 0xeb;
= 0xed;
= 0xf9;
= 0xfb;
= 0xfd;
// data pointer
// ADC0 data
// ADC0 greater than window
// ADC0 less than window
// Timer2 capture/reload
// Timer3 capture/reload
// Timer4 capture/reload
// Timer2
// Timer3
// Timer4
// DAC0 data
// DAC1 data
// PCA0 Module 5 capture
// PCA0 Module 2 capture
// PCA0 Module 3 capture
// PCA0 Module 4 capture
// PCA0 counter
// PCA0 Module 0 capture
// PCA0 Module 1 capture
//-----------------------------------------------------------------------------
// Global CONSTANTS
Rev. 1.3
11