Connect with us

Timer0 16 bit mode in the pic18f4550

Discussion in 'Microcontrollers, Programming and IoT' started by khoitv, Aug 20, 2011.

Scroll to continue with content
  1. khoitv

    khoitv

    1
    0
    Aug 20, 2011
    Hi all
    I have write a program as below. using MIKROC FOR PIC compiler, i configure for microcontroller is 16 bit mode, but when simulate by ISIS it is not operated in 16 bit mode.
    do you know why? please explain me why?
    Thanks
    /////////////////
    unsigned short cnt;
    void interrupt()
    {
    cnt++;
    INTCON = 0x20; // Set T0IE, clear T0IF

    }
    void main()
    {
    cnt=0;
    trisb=0;
    portb=0;
    t0con=0x08;
    tmr0h=0x00;
    tmr0l=0x00;
    intcon=0xa0;
    tmr0on_bit=1;
    while(1)
    {
    if(cnt=10000)
    {
    cnt=0;
    portb=~portb;
    }
    }
    }
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-