Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Using external clock for 16 bit counter in Atmega 8

Status
Not open for further replies.

alfie.max15

Member level 2
Member level 2
Joined
Jan 3, 2013
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,660
I am using Atmega 8 16 bit counter.
It works fine with the internal clock.
But when tryin to use a signal as external clock on T1 pin on the uC the pin stays high all the time.



Code C - [expand]
1
2
3
4
5
6
7
DDRD &= ~(1 << DDD5);     // Clear the PD5 pin      
   // PD5 is now an input 
    
   PORTD |= (1 << PORTD5);   // turn On the Pull-up      
   // PD5 is now an input with pull-up enabled 
    
   TCCR1B |= (1 << CS12) | (1 << CS11) | (1 << CS10);     // Turn on the counter, Clock on Rise



I used the above code so as to use the external clock on pin T1
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top