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.

can i assume external interrupt will do same action with this code?

Status
Not open for further replies.

lockman_akim

Advanced Member level 1
Advanced Member level 1
Joined
Jul 12, 2010
Messages
466
Helped
76
Reputation
152
Reaction score
68
Trophy points
1,308
Location
Malaysia
Activity points
3,523
i allready read about interrupt..and i have doubt about external interrupt..
let say, my interrupt source is at RB0..while no interrupt flag, LED at RD0 is ON RD1 is OFF, when interrupt triggered, led at RD1 is ON RD0 is OFF..

without using interrupt, it still can happen with this code,

if RB0 = 0 then

RD0 = 1
RD1 = 0

Else

RD0 = 0
RD1 = 1

End if


so where is the speciallity of interupt function?

can anyone give me an example for some situation that i should use external interrupt?
 

Hi,

You can test Port B from your main program loop anytime you want, however you may find that restrictive if you are doing other intensive work in the main loop.

Using the interrupts relieves that Port testing pressure from the main program loop.

Typical example would be a door switch connected to RBO so it would Interrupt the main program loop when activated, the main loop does not constantly have to test RB0.
Many timers use the Interrupts, the main program loop sets of the Timer , when its short delay is complete it sets its Interrupt flag On, the ISR is activated where the timer is Reset, re-activated and user registers / counters are updated without the main program loop doing any work.
 
can interrupt handle multasking?
how can i run this loop program in same time?

dim led as byte
dim pos as byte

led:

if led<255 then
led = led + 1
else
led = 0
end if
delayms 1000

goto led


lcd:

print at 1,1, "hello"
delayms 1000
print at 2,1,"World"
delayms 1000
cls

goto lcd


if i run this.for sure the lcd loop will not execute..so how can i this execute this 2 loops in same time?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top