Shop OBEX P1 Docs P2 Docs Learn Events
Who says Propellers don't have interrupts??? — Parallax Forums

Who says Propellers don't have interrupts???

mindrobotsmindrobots Posts: 6,506
edited 2014-03-30 19:30 in Propeller 2
Every time I sit down to do anything with a Propeller, I seem to get interrupted! Often to the point of abandoning my Propeller plans!

Chip, can you remove that feature from the P2 before it goes to silicon?? :lol:
«1

Comments

  • AribaAriba Posts: 2,682
    edited 2014-03-28 12:04
    mindrobots wrote: »
    Every time I sit down to do anything with a Propeller, I seem to get interrupted! Often to the point of abandoning my Propeller plans!

    Chip, can you remove that feature from the P2 before it goes to silicon?? :lol:

    You need to adjust your personal interrupt priority settings. Just give the Prop2 tasks priority over all these insignificant other tasks, like day-work, family, eating, sleeping ...

    Andy:smile:
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-03-28 12:06
    Great idea until a big ZERO lands in your NMI vector!

    p2ben-2.jpg
    1024 x 768 - 99K
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-03-28 12:09
    LOL!

    That is too funny.
  • ctwardellctwardell Posts: 1,716
    edited 2014-03-28 12:16
    Ah, your doing the ESD testing on the DE2-115! ;-)

    C.W.
  • AribaAriba Posts: 2,682
    edited 2014-03-28 12:17
    mindrobots wrote: »
    Great idea until a big ZERO lands in your NMI vector!

    LOL

    This kind of interrupt should be resolvable with using some high voltage for a moment...

    Andy
  • Heater.Heater. Posts: 21,230
    edited 2014-03-28 13:01
    That is beautiful.

    As far as I know one thing that cats really hate is interrupts.

    Ergo, cats love Propellers :)

    Of course the other thing that cats like is warm places. That might not be so good in this context.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-03-28 14:38
    Aha! I see you are investigating using a "cats wisker" in a new project ;)
  • Heater.Heater. Posts: 21,230
    edited 2014-03-28 14:56
    I'm worried.

    One of the best ways to generate IC killing static electricity is to rub plexiglass and a cat together. Here we have all three in close proximity !
  • Jen J.Jen J. Posts: 649
    edited 2014-03-28 15:13
    Great photo, mindrobots!
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-03-28 17:38
    Heater. wrote: »
    I'm worried.

    One of the best ways to generate IC killing static electricity is to rub plexiglass and a cat together. Here we have all three in close proximity !

    Yeah, CW brought tnat up too. I'll have to break that habit before bad things happen. Now I'm worried too!
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-03-28 17:39
    Jen J. wrote: »
    Great photo, mindrobots!
    Thanks, it just happened. Cats do that.
  • ozpropdevozpropdev Posts: 2,791
    edited 2014-03-28 18:17
    Cats are very useful debugging tools too!
    My cat should be quite proficient in P2 PASM as I find myself talking out load about bugs I'm chasing.
    "Whats going on here puss!"
    or the very popular
    "What am I doing wrong puss!"
    Using this technique has solved many problems! :lol:
    Cheers
    Brian
  • DmashekDmashek Posts: 49
    edited 2014-03-29 00:19
    I have heard of "debugging" hardware, but this is the first time I have seen "decatting"! ;)
  • doggiedocdoggiedoc Posts: 2,239
    edited 2014-03-29 05:53
    Heater. wrote: »
    I'm worried.

    One of the best ways to generate IC killing static electricity is to rub plexiglass and a cat together. Here we have all three in close proximity !

    One option could be to liberally apply this to your cat...

    static.jpg
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-03-29 06:30
    doggiedoc wrote: »
    One option could be to liberally apply this to your cat...

    static.jpg

    So far, one out of one veterinarians recommend Static Gaurd for cats. Cool! :lol:
  • doggiedocdoggiedoc Posts: 2,239
    edited 2014-03-29 08:22
    mindrobots wrote: »
    So far, one out of one veterinarians recommend Static Gaurd for cats. Cool! :lol:
    Perhaps some experimental data will help. I should get right on that...
  • potatoheadpotatohead Posts: 10,254
    edited 2014-03-29 16:19
    Awesome photo. Thanks for sharing it with us.
  • ellipserellipser Posts: 43
    edited 2014-03-29 17:28
    On a more serious note, there is a technical reason the Prop doesn't have interrupts, right? Simply because it would make each cog out of sync? Yes, no?

    What would happen if each cog were re-designed with an interrupt? Just wondering.

    Just an opinion here, but there is no need for them when you have 8 processors. There are enough for most jobs, so that each can stay focused on one task, eliminating the need for an interrupt.
  • Heater.Heater. Posts: 21,230
    edited 2014-03-29 18:54
    You answered your question in yourself in your third paragraph.

    Interrupts are an ugly hack to get a single processor appear to be many. Interrupts give rise to all kinds of complexity in having to worry about latencies, priority levels etc, which are all removed if you actually have many processors.

    Now that we have hardware scheduled threads with the ability to wait on events interrupts are even less desirable.

    As a huge bonus not having interrupts makes code sharing and reuse, for example by the use of Spin objects in the OBEX, much much easier.

    I could go on but this has been discussed at extreme length on these forums for years already.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-03-29 21:20
    ellipser,

    What Heater said.

    With eight cogs, each of which can run up to four tasks, there really is no need for hardware interrupts.

    Having said that, if you want interrupts, they are trivial to implement in software.

    Set aside a cog as an "interrupt handler"

    have a simple loop, that checks pins, and calls an "interrupt handler" when the pin changes.

    Presto, interrupts.

    Don't want to use a whole cog?

    Run the "interrupt handler" as a task.

    You'll still get a lower interrupt latency than many mcu's that support interrupts, with far less complexity, and far higher predictability.
  • evanhevanh Posts: 15,192
    edited 2014-03-30 05:03
    ellipser wrote: »
    On a more serious note, there is a technical reason the Prop doesn't have interrupts, right? Simply because it would make each cog out of sync? Yes, no?

    Nope, no technical reason other than Chip chose not to have interrupts. It is a little interesting to see how many people dislike interrupts but do like their preemptive multitasking.
  • Heater.Heater. Posts: 21,230
    edited 2014-03-30 05:09
    evanh,

    Isn't being redundant a sufficient technical reason not to do something?

    I agree, those who favour preemtive scheduling but dismiss interrupts seem rather self-contradictory. A preempt is an interrupt after all.
  • cgraceycgracey Posts: 14,133
    edited 2014-03-30 07:18
    Heater. wrote: »
    evanh,

    Isn't being redundant a sufficient technical reason not to do something?

    I agree, those who favour preemtive scheduling but dismiss interrupts seem rather self-contradictory. A preempt is an interrupt after all.


    But, it's a scheduled interruption, and not one of many that may compound at inopportune times.
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-03-30 07:25
    Since a preemption is an interrupt it does become self-contradictory to say the Propeller doesn't have interrupt but supports preemptive multi-threading. How about we make this statement:

    "The Propeller does not have a hardware interrupt facility at the core of its architecture however it is able to simulate a hardware interrupt in many ways giving it a "soft" interrupt facility. With this soft interrupt facility, you can implement preemptive (interrupt driven) functionality."

    If you look at other processors, the MSP430 in this case, you see interrupts are at the very core of the architecture.
    3.2 Global Interrupt Structure
    There are three types of interrupts:

    System reset

    Non-maskable interrupts

    Maskable interrupts
    Sources causing a system reset are:

    Applying supply voltage @ POR, PUC

    'low' on
    ,
    ,
    RST/NMI (if reset mode selected) @ POR, PUC

    Watchdog timer overflow (if watchdog mode selected) @ PUC

    Watchdog timer security key violation @ PUC

    (writing to WDTCTL with incorrect password)
    A non-maskable interrupt can be generated by:

    Edge on
    ,
    ,
    RST/NMI-pin (if NMI mode selected)

    Oscillator fault
    Note: Oscillator fault
    The oscillator fault is maskable by an individual enable bit OFIE. It is not disabled
    during a general interrupt enable (GIE) reset.
    Sources for maskable interrupts are:

    Watchdog timer overflow (if timer mode is selected)

    other modules having interrupt capability

    The Propeller has no such functionality described in hardware.

    Another fact that contributes to the basic philosophy of the Prop that Chip has stated many times and that we've settled on during the P2 community design process. The Propeller gives you the features in hardware you need to construct more complex functions or features that aren't in the hardware. Typical soft peripheral drivers are done through bit banging and polling but it is certainly possible to use the pins and WAITPxx instructions to implement something that appears to be interrupts.

    With the preemptive multi-threading, there still aren't hardware interrupts, down deep, the hardware is still made to poll something under software control and then generate something the looks like an interrupt to trigger the thread context switch. Yes, it's a preemption(interrupt) to the thread but there is not hardware interrupt happening.

    It's all part of the beauty of our 500 instruction RISC architecture!! :lol:
  • Heater.Heater. Posts: 21,230
    edited 2014-03-30 10:44
    Yes, yes, a different kind of interrupt. There are many kinds of interrupt, hardware, software, exception trap, masked, unmasked, non-maskable, prioritized etc etc.

    minrobots,
    It's all part of the beauty of our 500 instruction RISC architecture!! ;)
    I love it :)

    I suspect we won't be seeing that on the PII product brief though.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-03-30 10:52
    I love the rich instruction set!

    Frankly, I was surprised at the CHK*** text support instructions.

    Then, after overcoming surprise, I was pleased.

    As they did not require a lot of logic, and there was room in the instruction set, they are a great way of saving memory.

    Sure, writing the equivalent subroutines is trivial - but passing the register is not, so unless one was permanently dedicated, using such instructions saves at least one long per use.

    That adds up quick :)

    Due to memory limitations, I look forward to even more instructions that will save memory :)
  • Heater.Heater. Posts: 21,230
    edited 2014-03-30 11:27
    Bill,

    Yes of course, that's it. Just redefine the acronym RISC = Rich Instruction Set Computer.

    That can go on the PII product brief along with "32 bit, 8 core, hyper-threaded architecture". The definition of "RISC" can be in very small print at the bottom of the page :)
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-03-30 11:58
    LOL!!!!

    Works for me.

    But seriously, I love that the p2 is still assembly language centric, but with a healthy helping of compiler-assist instructions.

    Just think of the extra helper instructions as a built-in libpasm.a :):):)
    Heater. wrote: »
    Bill,

    Yes of course, that's it. Just redefine the acronym RISC = Rich Instruction Set Computer.

    That can go on the PII product brief along with "32 bit, 8 core, hyper-threaded architecture". The definition of "RISC" can be in very small print at the bottom of the page :)
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-03-30 13:33
    Look at the instruction set in a different light...

    The P2 has a RISC base set of instructions augmented by a special set of advanced instructions that (a) perform DSP style instructions such as multiply, divide, cordic, and (b) perform multiple instructions within a single instruction, and (c) perform special instructions for things such as stacks, extended call and return instructions, and (d) perform additional miscellaneous instructions.

    The RISC instructions are the older P1 Instructions, with some minor differences.
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-03-30 13:44
    eRISC - enhanced RISC - a basic small compact set of instructions enhanced by special features targeted toward assembler programmers. It's becoming a multi-faceted processor that depending on how you look at it and which features you choose to exploit, you can accomplish several different tasks. Not only does it offer the flexibility of soft peripherals but the enhanced instruction sets allows you to use dramatically different core architectures. That sort of flexibility once you wrap your head around it justifies the instruction set.
Sign In or Register to comment.