參數(shù)資料
型號(hào): MC68HC11N4
廠商: Motorola, Inc.
元件分類(lèi): 8位微控制器
英文描述: 8-Bit microcontroller(8位微控制器)
中文描述: 8位微控制器(8位微控制器)
文件頁(yè)數(shù): 13/24頁(yè)
文件大小: 261K
代理商: MC68HC11N4
AN1215/D
MOTOROLA
13
interrupt void RTI_interrupt(void) /*PID LOOP/PWM routine */
{
PORTA = 0xFF; /* scope strobe */
DOIO(); /* read A to D and output the duty
cycle calculated last period */
ADCTL = 0x10; /* begin new conversion cycle */
ERRX = (CMNDVX - ADRCX); /* calculate current error */
/* The statement below is the entire floating point PID loop */
NEWDTY = KP*(ERRX) + KI*PERDT*(CMNDVX - (ADRCX + ADRCXM1)/2)
+ (KD/(6*PERDT))*((ERRX - ERRM3X) + 3*(ERRM1X - ERRM2X))
+ OLDDTY;
if (NEWDTY > 1.99609) /* test for result being in usable */
NEWDTY = 1.99609; /* limits and set PWM duty cycle if */
else if (NEWDTY < 1.0) /* beyond saturation */
NEWDTY = 1.0;
TFLG2 = 0x40; /* clear RTI flag */
ADRCXM1 = ADRCX; /* update A/D result for next cycle */
ERRM3X = ERRM2X; /* update error pipeline */
ERRM2X = ERRM1X;
ERRM1X = ERRX;
OLDDTY = NEWDTY; /* update old duty cycle for next
calculation period */
PORTA = 0x00; /* scope strobe */
}
A.2 DOIO Subroutine Assembler Listing
1 *********************************************************
2 * DOIO assembly function *
3 * This routine handles the conversion between *
4 * 8 bit register values and the C float variables *
5 * *
6 *********************************************************
7
8 0000 MODULE DOIO
9 0000 PUBLIC DOIO
10
11 0000 P68H11
12 0000 RSEG CODE
13
14 006C PWDTY1 set $006c REGISTER LOCATIONS
15 0031 ADDR1 set $0031
16 0000 EXTERN ADRCX:ZPAGE EXTERNAL VARIABLE LOCATIONS
17 0000 EXTERN NEWDTY:ZPAGE
18 0000 DOIO:
19 0000 863F LDAA #$3F
20 0002 5F CLRB
21 0003 DD00 STD ADRCX INITIALIZE FLOAT LOCATION.
22 0005 9631 LDAA ADR1 GET CHANNEL 1 A/D RESULT.
23 0007 04 LSRD SHIFT TO FLOAT MANTISSA POSITION.
24 0008 8A80 ORAA #$80 OR IN LEAST SIGNIFICANT EXP BIT
25 000A DD01 STD ADRCX+1 AND STORE IT IN FLOAT VARIABLE.
26 000C 5F CLRB CLEAR LEAST SIGNIFICANT
27 000D D703 STAB ADRCX+3 FLOAT BYTE.
28 000F DC01 LDD NEWDTY+1 GET TWO BYTES OF FLOAT MANTISSA.
29 0011 05 LSLD SHIFT TO CORRECT REGISTER POSITION.
30 0012 976C STAA PWDTY1 OUTPUT TO PWM DUTY REGISTER.
31 0014 39 RTS
32 0015 END
相關(guān)PDF資料
PDF描述
MC68HC12BE32 16-bit Microcontroller Units (MCUs)(16位微控制器)
MC68HC16R1 16-Bit Modular Microcontroller(16位模塊化微控制器)
MC68HC916R1 16-Bit Modular Microcontroller(16位模塊化微控制器)
MC68HC16Y1 16-Bit Modular Microcontroller(16位模塊化微控制器)
MC68HC16Z1 16-Bit Modular Microcontroller(16位模塊化微控制器)
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
MC68HC16Z1CAG 制造商:Freescale Semiconductor 功能描述:
MC68HC16Z1CAG16 功能描述:16位微控制器 - MCU 16 BIT MCU 1K RAM RoHS:否 制造商:Texas Instruments 核心:RISC 處理器系列:MSP430FR572x 數(shù)據(jù)總線寬度:16 bit 最大時(shí)鐘頻率:24 MHz 程序存儲(chǔ)器大小:8 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:2 V to 3.6 V 工作溫度范圍:- 40 C to + 85 C 封裝 / 箱體:VQFN-40 安裝風(fēng)格:SMD/SMT
MC68HC16Z1CAG16 制造商:Freescale Semiconductor 功能描述:IC16-BIT MICROCONTROLLER
MC68HC16Z1CAG20 功能描述:16位微控制器 - MCU 16 BIT MCU 1K RAM RoHS:否 制造商:Texas Instruments 核心:RISC 處理器系列:MSP430FR572x 數(shù)據(jù)總線寬度:16 bit 最大時(shí)鐘頻率:24 MHz 程序存儲(chǔ)器大小:8 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:2 V to 3.6 V 工作溫度范圍:- 40 C to + 85 C 封裝 / 箱體:VQFN-40 安裝風(fēng)格:SMD/SMT
MC68HC16Z1CAG20 制造商:Freescale Semiconductor 功能描述:Microcontroller