參數(shù)資料
型號(hào): MC68HC11N4
廠商: Motorola, Inc.
元件分類: 8位微控制器
英文描述: 8-Bit microcontroller(8位微控制器)
中文描述: 8位微控制器(8位微控制器)
文件頁數(shù): 15/24頁
文件大小: 261K
代理商: MC68HC11N4
AN1215/D
MOTOROLA
15
void main() /* main program */
{
CMNDVX = 0x0080;
PERDTNUM = 0x00A4;
PERDTDEN = 0x2710; /* PERIOD = 164/10000 decimal */
KPNUM = 0x000C;
KPDEN = 0x0064; /* kp = .12, ki = 6.0, kd = .006, for 1M ohm drive */
KINUM = 0x0006;
KIDEN = 0x0001;
KDNUM = 0x0006;
KDDEN = 0x03E8;
OLDDTY =0x00FF0000;
PORTA = 0x00;
DDRA = 0xFF; /* set PORTA as output */
PACTL = 0x03; /* set RTI to 16.383 ms (E = 4MHz) */
TMSK2 = 0x40; /* enable RTI interrupts */
OPTION = 0x90; /* enable A/D charge pump */
PWPER1 = 0xFF; /* set up PWM channel 1 at 15.625 kHz */
PWDTY1 = 0xFF; /* with positive polarity */
PWPOL = 0x01;
DDRH = 0x00;
PWEN = 0x01;
TFLG2 = 0x40;
enable_interrupt(); /* wait for RTI to execute assembly PID routine */
wait_for_interrupt();
for (;;) {
; }
}
interrupt void IRQ_interrupt(void) /* Just some traps for unexpected */
{ /* interrupts */
PORTA = 0xFF;
PORTA = 0x00;
}
interrupt void TO_interrupt(void)
{
TOFCOUNT++ ;
}
interrupt void RTI_interrupt(void) /* PWM routine */
{
PORTA = 0xFF; /* scope strobe */
DOPID(); /*DO THE PID LOOP USING THE MATH
COPROCESSOR */
/* NEWDTY = KP*(ERRX) + KI*PERDT*(CMNDVX - (ADRCX + ADRCXM1)/2)
+ (KD/(6*PERDT))*((ERRX - ERRM3X) + 3*(ERRM1X - ERRM2X))
+ OLDDTY; */
TFLG2 = 0x40; /* clear RTI flag */
ADRCXM1 = ADRCX; /* update A/D result for next cycle */
ERRM3X = ERRM2X; /* update error pipeline */
ERRM2X = ERRM1X;
ERRM1X = ERRX;
PORTA = 0x00; /* scope strobe */
}
相關(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