Binary Counter

The project was designed by Wagner Rambo in one of his lessons on youtube. It uses PORTB as an output. The value of PORTB is incremented with 1 once every 300us. The result is a binary counter on PORTB. The microcontroller directly converts from decimal to binary, without implementing any logic in this regard. The pins of microcontroller in Proteus are monitorized by some probe state.

void main()

{

   // RB 76543210

   TRISB = 0b00000000; // make the corresponding PORTB pin an output

    PORTB = 0b00000000; // Make all PORTB pins LOW..

while(1)

{

     PORTB++;  //PORTB = PORTB + 1

     delay_ms(300);

}

}