This is topic My baby Emma - ugrent need of parenting advice in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=039835

Posted by Beanny (Member # 7109) on :
 
Well, she might not be a baby, but Emma is a charming little robot who is going to participate in a firefighting competition. Divided to three teams of eight, my robotics class is building three robots - one of them (the winner) is Emma.

I'm now programming with Assembler, which is very fun, but I've got a question for all you programmers: what do we need an "interrupt" for? I know how to create one, more or less, but I have no idea what it really MEANS. Here's an example for a problem given to us for exercise:

Write a program, that will activate the buzzer (we're using an SES DSM-2095 card) at a frequency of 5kHz with a Duty Cycle of 60% if the Switch0 is on, and frequency 80Hz with a Duty Cycle of 40% if the switch is off.

Now, it's not too difficult to write that program (we have two unrelated timers with a tclock of 1.085microseconds), but what use does it have? And is that for sure what you call an interrupt?

Thank you very much...........
-Beanny

Edited for clarity

[ December 04, 2005, 07:30 AM: Message edited by: Beanny ]
 
Posted by Minerva (Member # 2991) on :
 
What you want to google for is "hardware interrupt."

http://www.boondog.com/%5Ctutorials%5Cirq%5Cirq.htm
 
Posted by Beanny (Member # 7109) on :
 
Thanks, but alas...it might be my English and it might be because of the website, but I still can only see the program itself and not what stands behind it.
 
Posted by Minerva (Member # 2991) on :
 
An interrupt is a signal stops the flow of a program so another action can be taken.

In your situation, Switch0 would "interrupt" the main program, and change the buzzer frequency.
 
Posted by Beanny (Member # 7109) on :
 
I think I understand. You mean it's something like: Emma gets to close to the wall, so then there's an interrupt that goes: "stop what you're doing and go back to the middle".
 
Posted by Minerva (Member # 2991) on :
 
There's a "wall-proximity sensor" that says, "Hey, I see a wall." Your program decides that the response to "seeing a wall" is to go back to the middle.

On a desktop, the keyboard interrupts will be something like, "Hey, someone just pressed 'K'"
 
Posted by Beanny (Member # 7109) on :
 
I see...thank you very much!
 


Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2