欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

˜Ë(bi¨¡o)î}: °l(f¨¡)¬F(xi¨¤n)M16µÄTC1µÄÖØ´óȱÏÝ£¡£¡£¡£¡£¡ [´òÓ¡±¾í“]

×÷Õß: dianz1024    •rég: 2012-7-25 22:56
˜Ë(bi¨¡o)î}: °l(f¨¡)¬F(xi¨¤n)M16µÄTC1µÄÖØ´óȱÏÝ£¡£¡£¡£¡£¡
°l(f¨¡)¬F(xi¨¤n)M16µÄTC1µÄÖØ´óȱÏÝ£¡£¡£¡£¡£¡ ±¾ÈËÓÃM16µÄTC1®a(ch¨£n)ÉúPWMÐÅÌ–£¬²¢ÇÒÔÚ®a(ch¨£n)ÉúÐÅÌ–µÄͬ•r²»”à¸Ä׃îlÂÊ£¬µ«×ƒîl·ù¶ÈºÜС£¬ß@•r¾Í³ö¬F(xi¨¤n)Ò»‚€ºÜÁîÈËÙM½âµÄ¬F(xi¨¤n)Ïó£¬PWMÐÅÌ–•þ²»•rÓДàé_µÄ¬F(xi¨¤n)Ïó PWMîlÂÊ£º28KHz OC1A¡¢OC1Bëp·ݔ³ö£ºÏëµÃµ½µÄÐÅÌ–ÊÇ£ºÈçˆDÕý³£µÄ²¨ÐÎ µ«ÊÇÒ»µ©¸Ä׃îlÂÊ£¬ƒÉ·µÄÐÅÌ–•þëS¼´µÄÖДà6.5ms×óÓÒ,ÈçˆD”àé_µÄ²¨ÐΣ¬²»ÖªÆä½â£¬¸÷λ¸ßÊÖÕˆÖ¸½Ì ³ÌÐò£º // Target : M16 // Crystal: 10.000Mhz #include #include void port_init(void) { PORTA = 0x00; DDRA = 0x00; PORTB = 0x00; DDRB = 0x00; PORTC = 0x00; //m103 output only DDRC = 0x00; PORTD = 0x00; DDRD = 0b00110000; } //TIMER1 initialize - prescale:1 // WGM: 8) PWM phz freq correct, TOP=ICRn // desired value: 28KHz // actual value: 28.090KHz (0.3%) void timer1_init(void) { TCCR1B = 0x00; //stop TCNT1H = 0xFF; //setup TCNT1L = 0x4E; OCR1AH = 0x00; OCR1AL = 0xB2-0x50; OCR1BH = 0x00; OCR1BL = 0x50; ICR1H = 0x00; ICR1L = 0xB2; TCCR1A = 0xB0; TCCR1B = 0x11; //start Timer } //call this routine to initialize all peripherals void init_devices(void) { //stop errant interrupts until set up CLI(); //disable all interrupts port_init(); timer1_init(); MCUCR = 0x00; GICR = 0x00; TIMSK = 0x00; //timer interrupt sources SEI(); //re-enable interrupts //all peripherals are now initialized } void Delay(unsigned int t) { unsigned int i,j; for(i=0;i9)i=0; Delay(100); //ÑÓ•r ICR1L=ICR1L_+i; //¸Ä׃îlÂÊ } }






šgÓ­¹âÅR (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1