wasif_khan
Newbie level 2
- Joined
- Dec 13, 2014
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 14
Actually I want to count that how many times switch has pressed. For this I made **T0CK1** as input of switch and put TMR0 on external crystal but its not working as I thought it would be
Code I made with my little knowledge about timers
Code I made with my little knowledge about timers
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 #include<p18f452.h> void main() { TRISAbits.RA4=1; // COnfigure RA4 as input Port. (External Clock) T0CON=0xA8; // No Prescale, 16-bit mode, External Clock TRISB=0x00; while(1) { PORTB=TMR0L; //just for the show that it has incremended } }
Last edited by a moderator: