need timer interrupt using assembly language.
Sat Aug 29 2009, 08:18 pm
i require code for 5 sec delay using timer interrupt 0 in 16-bit mode in assembly language for 89s51.
Sun Aug 30 2009, 04:14 pm
well i explained many times..
create 50ms timer and then use a counter to count 100. coz 100*50 = 5000ms = 5sec
create 50ms timer and then use a counter to count 100. coz 100*50 = 5000ms = 5sec
Sun Aug 30 2009, 08:44 pm
my friend i wannna do it using timer interrupt and hope u give me program for that.
Mon Aug 31 2009, 01:12 am
Well i cant give your a program, but you can do that in interrupt.. just add the counter logic in interrupt routine.
write something yourself, i will rectify it incase of any errors. unless you try you wont learn.
write something yourself, i will rectify it incase of any errors. unless you try you wont learn.
Mon Aug 31 2009, 01:03 pm
Let me explain you the steps to perform Timer interrupt0:-
----------------------------------------------------------------------
1. Enter "IE" reg. value to initialize the timer0 interrupt.
2. Enter the "TMOD" reg. value to select the timer0 with 16-bit mode.
3.Enter the values at "TH0 & TL0" as per the time delay you requested.
ex:-If 12MHz XTAL connected means, the constant time delay taken between each count is 1µsec. Else if 24MHz XTAL means, then 0.5µsec is the constant time delay.
4. Start the timer0.
5. Write the ISR program under the pre-defined Timer interrupt 0 address.
----------------------------------------------------------------------
1. Enter "IE" reg. value to initialize the timer0 interrupt.
2. Enter the "TMOD" reg. value to select the timer0 with 16-bit mode.
3.Enter the values at "TH0 & TL0" as per the time delay you requested.
ex:-If 12MHz XTAL connected means, the constant time delay taken between each count is 1µsec. Else if 24MHz XTAL means, then 0.5µsec is the constant time delay.
4. Start the timer0.
5. Write the ISR program under the pre-defined Timer interrupt 0 address.
Mon Aug 31 2009, 05:03 pm
MR GOPI AND AJAY
I AM SENDING U MY PROGRAM USING ADC 0804 HERE I AM DISPLAYING 336V WITH THREE 7 SEGMENT DISPLAY.
SO WHEN I MAKE MY MACHINE ON DURING CAPACITOR TAKES 3 SECONDS TO CHARGE UPTO 336V
SO I NEED TO PUT DELAY FOR 5 SEC TO ALLOW NOT TO GET OL ERROR AROUND 220V TO 200V WHEN I PROVIDE SUPPLY. FOR FIRST TIME U WILL BE ABLE TO GET IT AND I WANNA USE TIMER INTERRUPT TO CHECK OL VOLTAGE AFTER EVERY 5 SEC. I AM ATTACHING MY PROGRAM WITH THE HELP OF TIMER VERIFY WHETHER I AM CORRECT.
I AM SENDING U MY PROGRAM USING ADC 0804 HERE I AM DISPLAYING 336V WITH THREE 7 SEGMENT DISPLAY.
SO WHEN I MAKE MY MACHINE ON DURING CAPACITOR TAKES 3 SECONDS TO CHARGE UPTO 336V
SO I NEED TO PUT DELAY FOR 5 SEC TO ALLOW NOT TO GET OL ERROR AROUND 220V TO 200V WHEN I PROVIDE SUPPLY. FOR FIRST TIME U WILL BE ABLE TO GET IT AND I WANNA USE TIMER INTERRUPT TO CHECK OL VOLTAGE AFTER EVERY 5 SEC. I AM ATTACHING MY PROGRAM WITH THE HELP OF TIMER VERIFY WHETHER I AM CORRECT.
Wed Sep 02 2009, 01:34 pm
Ok Buddy. I am sending one reference code where a set of leds connected to PORT1 has to be blinked for every 1sec using timer0 interrupt with 16-bit mode. The XTAL used is 11.0592.
temp data 40h cnt data 00h org 00h ljmp main org 0bh clr tr0 djnz cnt,down mov cnt,#14 mov a,temp cpl a mov temp,a mov P1,temp mov th0,#0 mov tl0,#0 down: setb tr0 reti main: mov cnt,#14 mov temp,#55h mov tmod,#01h mov th0,#0 mov tl0,#0 mov ie,#82h setb tr0 sjmp $
[ Edited Wed Sep 02 2009, 05:35 pm ]
Powered by e107 Forum System