PIC Vietnam

Go Back   PIC Vietnam > namqn

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

Conversation Between namqn and kyo
Showing Visitor Messages 1 to 1 of 1
  1. kyo
    11-10-2008 11:14 PM
    kyo
    Nhờ anh xem chương trình này em viết tại sao ko chạy được. Em sử dụng timer0 để tạo thời gian delay bật tắt các led gắn vào portb của pic 16f877a, nhưng ko hiểu sao ko chạy được.
    Chương trình như sau:
    #include <16f877a.h>
    #fuses nowdt,noprotect,put,xt
    #use delay(clock=4000000)
    #use fast_io(b)
    #byte portb=0x06
    #int_timer0

    void ngat_tm0(void)
    {
    portb=0xff;
    }
    void main()
    {
    set_tris_b(0);
    enable_interrupts(global);
    enable_interrupts(int_timer0);
    set_timer0(250);
    setup_timer_0(rtcc_internal|rtcc_div_8);

    while(1)
    {
    portb=0x00;
    }
    }

Múi giờ GMT. Hiện tại là 12:46 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