21.07.2013 Views

THỰC HÀNH VI XỬ LÝ - Khoa Khoa học và Kỹ thuật Máy tính

THỰC HÀNH VI XỬ LÝ - Khoa Khoa học và Kỹ thuật Máy tính

THỰC HÀNH VI XỬ LÝ - Khoa Khoa học và Kỹ thuật Máy tính

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Trường ĐH. Bách <strong>Khoa</strong> TP.HCM <strong>Khoa</strong> KH & KTMT<br />

goto $<br />

Init_pwm<br />

bcf TRISC,2<br />

movlw 0x80<br />

movwf PR2 ;initialize PWM period<br />

movlw 0x80 ;initialize PWM duty cycle<br />

movwf CCPR1L<br />

bcf CCP1CON,CCP1X<br />

bcf CCP1CON,CCP1Y<br />

;postscale 1:1, prescaler 4, Timer2 ON<br />

movlw 0x05<br />

movwf T2CON<br />

movlw 0x0F ;turn buzzer on<br />

movwf CCP1CON<br />

return<br />

END<br />

9.3 Bài tập<br />

Tìm hiểu <strong>và</strong> hiện thực chương trình điều khiển RC Servo.<br />

Bộ môn <strong>Kỹ</strong> Thuật <strong>Máy</strong> Tính 75 Thực hành Vi xử lý

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!