2 questions
Lee Marshall
Posts: 106
i was wondering:
will the prop-2 have interrupt capability? will other cogs able to interrupt a cogs execution, and maybe force the cog to go to a certain vector?
i know the idea of 8 processors is supposed to eliminate the need, but it would be handy if one were designing a real multi-tasking OS for the prop.
what about undocumented instructions or secret pin functions, are there any?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I hear and I forget. I see and I remember. I do and I understand
-Confucius
will the prop-2 have interrupt capability? will other cogs able to interrupt a cogs execution, and maybe force the cog to go to a certain vector?
i know the idea of 8 processors is supposed to eliminate the need, but it would be handy if one were designing a real multi-tasking OS for the prop.
what about undocumented instructions or secret pin functions, are there any?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I hear and I forget. I see and I remember. I do and I understand
-Confucius
Comments
I've written several operating systems over the years that did the same sort of thing since the hardware required the use of interrupts. One was for the IBM System 360/370 and the other was for the Z-80. In both cases, there was a small low-level kernel that provided the same functionality of the COGNEW, COGSTOP, WAITxxx, and LOCKxxx instructions of the Propeller. Other kernel functions had to do with I/O operations and would not be necessary on the Propeller.
There are no intentionally undocumented instructions or pin functions in any of Parallax's microcontroller products. The only thing that has not been documented is the Stamp's byte code instructions and interpreter and, until recently, the Propeller's Spin byte code instructions and interpreter which has now been publicly released along with the source code of the Spin interpreter.
Post Edited (Mike Green) : 6/10/2008 6:05:19 PM GMT
-Phil
we have? Instead of using a single cog per input device, we could use a single
cog for all of them, using interrupts to switch from item to item.
I know.. heresy...
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Getting started with the Protoboard? - Propeller Cookbook 1.4
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card? - PropDOS
Need a part? Got spare electronics? - The Electronics Exchange
-Phil
So, my take on it is "If you want an interrupt, be my guest. Write one". In my case, I have not seen a need for them. I do need more cogs and memory! [noparse]:)[/noparse]
The only reason I ever wished I had an interrupt on the Prop is for processing inputs.· I know you can write one in software, but there is latency associated with that, especially if you are monitoring with one cog and messaging another cog.· The cog getting the message has to poll for it, which doesn't seem to have any advantages over polling the input directly.· The best way to work with the Prop is to forget about the concept of interrupts altogether and solve the problem another way.· The Prop performs the best when you focus on timing and determistic designs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Ken Peterson) : 6/10/2008 8:38:46 PM GMT
If you need something a bit like an interrupt then you can essentially add a command to any loop that says "am I interrupted?" this could be checking an io or the state of a hub variable/flag. This is not instant but may be fast enough for some things and at least it is somewhat deterministic, indeed the time required to service the "interupt" could already be factored in to the rest of the program's timing.
Graham
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔