Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Timer Interrupt operations

Status
Not open for further replies.

imranahmed

Advanced Member level 3
Joined
Dec 4, 2011
Messages
731
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
5,927
Please let me know about the function of Timer 1 or 0 interrupt.And what is the purpose of command using 0 after interrupt.
Is it possible to generate 1 sec delay by using timer interrupt 3 in 89c52?
 
Last edited:

jjeevan007

Full Member level 5
Joined
Apr 13, 2012
Messages
311
Helped
44
Reputation
88
Reaction score
43
Trophy points
1,308
Location
bangalore
Activity points
2,781
go through this following link for timer 1 and timer 0 operation

http://www.engineersgarage.com/tutorials/timers-8051-timer-programming-tutorial

for second question
i think the timer 2 is also 16 bit timer which can produce a maximum delay of .07 sec delay

to produce a 1 sec delay it better produce a delay of .05 seconds using one of the timer and repeat that for 20 times which gives 1 second delay.........
 

imranahmed

Advanced Member level 3
Joined
Dec 4, 2011
Messages
731
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
5,927
Please let me know what is the purpose of command "USING 0" in the interrupt.Like this
' void good() interrupt 0 using 0 '.
 

jjeevan007

Full Member level 5
Joined
Apr 13, 2012
Messages
311
Helped
44
Reputation
88
Reaction score
43
Trophy points
1,308
Location
bangalore
Activity points
2,781
the 0 defines the interrupt vector

for example:

0 External0
1 Timer0
2 External1
3 Timer1
4 Serial


when u make interrupt 0 then that is a ISR of the external interrupt 0

if interrupt 2 then that is a ISR of the external interrupt 1

if interrupt 1 then that is a ISR of the timer 0

and same

hope this was help full
 

sequel

Member level 4
Joined
Oct 27, 2012
Messages
76
Helped
8
Reputation
16
Reaction score
7
Trophy points
1,288
Location
Nigeria
Activity points
1,753
the command using is an assembler directive instructing the microcontroller to make use of the "register bank 0"...
 

imranahmed

Advanced Member level 3
Joined
Dec 4, 2011
Messages
731
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
5,927
How to know that how many register bank in 89c52 or any microcontroller ?
 

jjeevan007

Full Member level 5
Joined
Apr 13, 2012
Messages
311
Helped
44
Reputation
88
Reaction score
43
Trophy points
1,308
Location
bangalore
Activity points
2,781
just go through the data sheet of the corresponding data sheet and normally if u are using c programming language then the banking is take care by the compiler itself.........
 

imranahmed

Advanced Member level 3
Joined
Dec 4, 2011
Messages
731
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
5,927
Please let me know i wrote attached interrupt 1 (Timer 0) code it is working good, but when delay_ms function is used the timer interrupt connected LED does not

blink to proper timing.Please can anyone know about this problem?

I want to use both timer interrupt function and delay_ms function.I used Timer 0 in timer interrupt and Timer 1 in delay_ms function both on MODE 1.
 

Attachments


sequel

Member level 4
Joined
Oct 27, 2012
Messages
76
Helped
8
Reputation
16
Reaction score
7
Trophy points
1,288
Location
Nigeria
Activity points
1,753
am not a "C" coder but if you so wish i can upload a code in assembly language. so from there of u can convert it to "C"....
sequel
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top