PIC Vietnam

Go Back   PIC Vietnam > Các Đề Tài > Tổ dịch thuật

Tài trợ cho PIC Vietnam
Trang chủ Đăng Kí Hỏi/Ðáp Thành Viên Lịch Bài Trong Ngày Vi điều khiển

Tổ dịch thuật Dịch và biên soạn các tài liệu...

 
 
Ðiều Chỉnh Xếp Bài
Prev Previous Post   Next Post Next
Old 07-11-2007, 11:41 PM   #3
dvkkt
Đệ tử 3 túi
 
dvkkt's Avatar
 
Tham gia ngày: Oct 2007
Nơi Cư Ngụ: TPHCM
Bài gửi: 55
:
Send a message via Yahoo to dvkkt
Nguyền văn như sau:
_ The actual implementation of a delay routine based on multi-byte counters presents some dificulties. If the timer register (TMR0) is used to keep track of timer beats, then detecting the end of the count poses a subtle problem. Intuitively, our program could detect timer overflow by reading the TMR0 and testing the zero flag in the STATUS register. Since the movf instruction affects the zero flag, one could be tempted to code:
wait
movf tmr0,w
btfss status,z
goto wait
_ But there is a problem: the timer ticks as each instruction executes. Since the goto instruction takes two machine cycles, it is possible that the timer overflows while the goto instruction is in progress; therefore the overflow condition would not be detected.
dvkkt vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
 


Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt

Chuyển đến


Múi giờ GMT. Hiện tại là 03:35 PM.


Được sáng lập bởi Đoàn Hiệp
Powered by vBulletin®
Page copy protected against web site content infringement by Copyscape
Copyright © PIC Vietnam