243/317
8 - C Language and the C Compiler
The effect of this + sign is to remove the optimization for this file, that would normally remove
all the unused variable declarations, which would interfere with the allocation of the registers
to the proper addresses.
The header file looks like the excerpt below:
#pragma DATA_SEG SHORT TIMERA
/* timer A control register 2 */
extern
volatile unsigned char TACR2;
/* timer A control register 1 */
extern
volatile unsigned char TACR1;
/* timer A status register */
extern
volatile unsigned char TASR;
/* timer A input capture 1 high register */
extern
volatile unsigned char TAIC1HR;
/* timer A input capture 1 low register */
extern
volatile unsigned char TAIC1LR;
/* timer A output compare 1 high register */
extern
volatile unsigned char TAOC1HR;
/* timer A output compare 1 low register */
extern
volatile unsigned char TAOC1LR;
/* timer A counter high register */
extern
volatile unsigned char TACHR;
/* timer A counter low register */
extern
volatile unsigned char TACLR;
/* timer A alternate counter high register */
extern
volatile unsigned char TAACHR;
/* timer A alternate counter low register */
extern
volatile unsigned char TAACLR;
/* timer A input capture 2 high register */
extern
volatile unsigned char TAIC2HR;
/* timer A input capture 2 low register */
extern
volatile unsigned char TAIC2LR;
/* timer A output compare 2 high register */
extern
volatile unsigned char TAOC2HR;
/* timer A output compare 2 low register */
extern
volatile unsigned char TAOC2LR;
(.....)
/* Timers A&B Control Register 2 bit definition
*/
#define OC1E
0x07
// Output compare 1 pin
#define OC2E
0x06
// Output compare 1 pin
#define OPM
0x05
// One pulse mode
#define PWM
0x04
// PWM Mode
#define IEDG2
0x01
// Input edge 2
/* Timers A&B Status Register bit definition
*/
#define ICF1
0x07
// input capture interrupt bit
#define OCF1
0x06
// output capture interrupt bit
#define TOF
0x05
// overflow interrupt bit
#define ICF2
0x04
// input capture interrupt bit
#define OCF2
0x03
// output capture interrupt bit
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...