Does the basic stamp have hardware interupts?
MovieMaker
Posts: 502
simply put:
DOES THE BASIC STAMP HAVE HARDWARE INTERUPTS?
DOES THE BASIC STAMP HAVE HARDWARE INTERUPTS?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am 1011, so be surprised!
Advertisement sponsored by dfletch:
Come and join us on the Propeller IRC channel for fast and easy help!
Channel: #propeller
Server: irc.freenode.net or freenode.net
If you don't want to bother installing an IRC client, use Mibbit. www.mibbit.com
"This feature should not be confused with the concept of interrupts, as the
BASIC Stamp does not support true interrupts."
I think the code is more compatible with a lot of things I want to do. I did not get very far with Spin,ASM,BoebotBasic. I did everything I wanted to do individually, but not all together. I am not the programmer I was when I was younger. I wound up trying to change from one code to another to another and combine them all together and I said to myself, I would be better off just getting a language that had all the commands and codes I needed in one shot. Not that the propeller was bad or anything, I am just ignorant about it.
Hope I did not address too many issues here.
Thanks for letting me bend your ear.
Trust me ... "Interrupts" is a complex solution to the problem of having a single processor respond quickly to multiple, usually time-dependent, tasks.
Hardware interrupts are rife with bugs and logical collisions within your software since the processor is manually tom from whatever it is doing and transfers to a completely new task in a completely asynchronous manner.
Each Basic Stamp token calls up a short sub routine which is written in machine code. A true hard interrupt would break in at the middle of executing this sub routine. I can't imagine the chaos which would result for many of these tokens.
As to your question asking if the BASIC Stamp has hardware Interrupts the answer is yes for the modules based on the SX28 and SX48 processors. It is part of the micro controllers and they are discussed on the datasheet for that particular chip. However you have no way to access them or use them through the Interpreted BASIC Stamp code. So, from a programmers perspective of a BASIC Stamp user they don't exist since you can't use them. As mentioned before the higher level BASIC Stamps have a simulated Interrupt but it just polls pins.
If you really need access to Interrupts then you might want to take a look at the SX28 and the SX48 processors. Parallax has a BASIC compiler called SX/B that they offer as a free download. The syntax is a bit different than the BASIC Stamp but once you get use to it you can gain access to the true Hardware Interrupts, Hardware Timers, and also gain some speed.
Robert
The SX microcontroller makes extensive use of interrupts to do its work (virtual peripherals) and has some hardware features to make this easier.
By using the SX protoboard and the SX/B compiler you have access to two different types of interrupts.
The first type is a "periodic" interrupt. This interrupt occurs every "x" clock cycles. It is useful for measure time and timing events.
The other type is a "hardware" or pin change interrupt. This interrupt occurs wheneven a pin changes state. These are useful when you need to perform some action ASAP when a pin changes.
Interrupts are a challange to the beginner, but they are really handy once you get the hang of them.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·