MSeghir
Newbie
Hello everyone ..
If I want to make a counter from 0 to 99 with the following code, how can I make a function to do that in proteus??.. Note that I am a beginner in PIC..Thank you
- Proteus 8.5 Pro
- MikroC
Elements: The diagram is complete:
- Segment Cathode Display
- PIC 16F84A
- Decodeur 74LS48
The code :
The diagram is complete:
If I want to make a counter from 0 to 99 with the following code, how can I make a function to do that in proteus??.. Note that I am a beginner in PIC..Thank you
Software used:For your information, the following code works as a counter from 0 to 9 only..
- Proteus 8.5 Pro
- MikroC
Elements: The diagram is complete:
- Segment Cathode Display
- PIC 16F84A
- Decodeur 74LS48
The code :
C++:
void main() {
trisa= 0x00; porta=0;
trisb= 0x00; portb=0;
for(;;){
porta=0b00000010;
portb=0;
delay_ms(200);
porta=0b00000010;
portb=1;
delay_ms(200);
porta=0b00000010;
portb=2;
delay_ms(200);
porta=0b00000010;
portb=3;
delay_ms(200);
porta=0b00000010;
portb=4;
delay_ms(200);
porta=0b00000010;
portb=5;
delay_ms(200);
porta=0b00000010;
portb=6;
delay_ms(200);
porta=0b00000010;
portb=7;
delay_ms(200);
porta=0b00000010;
portb=8;
delay_ms(200);
porta=0b00000010;
portb=9;
delay_ms(200);
}
}
The diagram is complete: