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.

[SOLVED] Can I configure the TMOD to be used both as a timer and a counter at the same time?

Status
Not open for further replies.

09BEC036

Newbie level 3
Joined
Apr 16, 2012
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
can i configure the TMOD to be used both as a timer and a counter at the same time, say TMOD=0x25?
 

Re: timers/counters in 8051

can i configure the TMOD to be used both as a timer and a counter at the same time, say TMOD=0x25?

Yes, Since the lower 4 bits are for timer/counter 0. and higher 4 bits for timer/counter1.

To use as Timer0: Clear C/T bit of TMOD (2nd bit for timer/counter0).[3rd bit from right]

To use as Timer1: Clear C/T bit of TMOD (6th bit for timer/counter1).[7th bit from right]

To use as counter0: you have to SET 0 bit of TCON [righmost bit] and 2nd bit of TMOD[3rd bit from right].

To use as counter1: SET 2nd bit [3rd from right] of TCON and 6th bit [7th bit from right] of TMOD.
 
Re: timers/counters in 8051

Yes, Since the lower 4 bits are for timer/counter 0. and higher 4 bits for timer/counter1.

To use as Timer0: Clear C/T bit of TMOD (2nd bit for timer/counter0).[3rd bit from right]

To use as Timer1: Clear C/T bit of TMOD (6th bit for timer/counter1).[7th bit from right]

To use as counter0: you have to SET 0 bit of TCON [righmost bit] and 2nd bit of TMOD[3rd bit from right].

To use as counter1: SET 2nd bit [3rd from right] of TCON and 6th bit [7th bit from right] of TMOD.

thx :smile:
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top