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.

Interrupt programming help

Status
Not open for further replies.

Rohith_elec

Full Member level 4
Joined
Dec 16, 2011
Messages
198
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,470
What is the difference between software interupt and hardware interrupt ?
is the software interrupt initiated when a condition inside a code is satisfied ?
can anyone provide an example ?

thank you
Rohith
 

An example of software interrupt:
When the Timer 1 of PIC18F4620 gets overflowed, it automatically sets the INTCONbits.TMR0IF to 1.

Hardware interrupt is more like , pressing buttons on demo boards ( from an external stimuli)
 
can the software interrupt can be of any number ?
 

can the software interrupt can be of any number ?

What do you mean by any number? You have high, low priority on the interrupts. You can also select high-to-low or the other way round !
 

ok , i was asking that 5 different pushbutton and 5 different actions on each like , controlling an LED , controlling a motor , pwm on led and so forth
 

Hmm sure you can ! Controlling a motor, PWM would require a lot of coding but you can certainly do that!
 

Can the below code can be used for PWM ?

void pwm(int c)
{
output_high(PIN_B0);
delay_us(30);
output_low(PIN_B0);
delay_us(c);
}


by varying the delay , can we adjust the duty cycle ?
 

If its a function then you need a "return;" at the end of your pwm function!

Yup, I see no reason that will not work.
 

for an application like LED or motor , do i need to set the frequency (PWM frequency)?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top