Shop OBEX P1 Docs P2 Docs Learn Events
Always wanted to ask this... — Parallax Forums

Always wanted to ask this...

ArchiverArchiver Posts: 46,084
edited 2003-11-13 15:19 in General Discussion
Why doesnt the stamp support Interrupts?

Could someone from parallax also kindly explain.

Thanks

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-11-08 08:13
    --- In basicstamps@yahoogroups.com, harshit suri <suri_list@y...>
    wrote:
    > Why doesnt the stamp support Interrupts?
    >
    > Could someone from parallax also kindly explain.
    >
    > Thanks

    why not put in your own in the loop ?

    persnoally, I would preferr to not use for-next loops if just running
    thru the program and doing it one step at time will work just as well.

    Dave





    >
    > __________________________________
    > Do you Yahoo!?
    > Protect your identity with Yahoo! Mail AddressGuard
    > http://antispam.yahoo.com/whatsnewfree
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-08 08:48
    > why not put in your own in the loop ?

    Great idea but already used in one OS.
    But "Windoze on stamp" sounds great !
    Unless Mr Microsoft got it patented and then your are in double
    trouble!
    They would sue you first and than buy Parallax!
    No more nice controller chips to play with!
    Forget it! Bad bad idea!

    Just kidding. Keep ideas like this comming.
    Vaclav
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-08 12:30
    Probably for the same reason it doesn't support X-10 input commands.

    Leroy

    : Why doesnt the stamp support Interrupts?
    :
    : Could someone from parallax also kindly explain.
    :
    : Thanks
    :
    : __________________________________
    : Do you Yahoo!?
    : Protect your identity with Yahoo! Mail AddressGuard
    : http://antispam.yahoo.com/whatsnewfree
    :
    : To UNSUBSCRIBE, just send mail to:
    : basicstamps-unsubscribe@yahoogroups.com
    : from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    :
    :
    : Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    :
    :
    :
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-08 14:51
    I'm not from Parallax, but I think I can answer this. Interrupts
    dramatically increase the complexity of making things work properly for
    several reasons. The key to the Stamp is that it is easy to get impressive
    results.

    Suppose you have interrupts and you write:

    PAUSE 1000

    What do you do with an interrupt that occurs during this PAUSE (or PULSOUT)?
    Service it? Now the pause is too long. Wait until the PAUSE command
    completes? Now you have a giant interrupt latency.

    You might say, "But way, you could service the interrupt, add the ISR
    execution time to the PAUSE count, and then do the rest of the PAUSE."
    That's a good observation, but what about things like SERIN or SEROUT? These
    items have critical timing requirements.

    Interesting enough compilers like PIC Basic Pro have similar problems. If
    you enable their BASIC "interrupts" it is not really interrupts. It checks
    for an interrupt in between each BASIC instruction. If you want real
    interrupts you have to go to assembly.

    That's another problem with interrupts. The Basic Interpreter has to save
    its state. That takes some memory. There are several places that it might be
    hard to reenter (for example, what if during a SEROUT, and ISR tries to use
    SEROUT?).

    I'm not saying you couldn't make a Stamp with interrupts. But I am saying it
    would add a load of special cases and sources of error to the Stamp which
    would defeat its main purpose.

    Maybe if they made interrupts optional and you had to know the secret
    handshake to get access to them....

    Al Williams
    AWC
    *NEW: Directly Read Position Data from a PS/2 Mouse:
    http://www.al-williams.com/pak11.htm


    >
    Original Message
    > From: harshit suri [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=dtZvVBQ2odagbOBJrflgBsLA9yzgG9zBiRML_aonbUnb9rsOpCHHnzgB4wOXGCgYuU3z3xZPi9WPvsWD]suri_list@y...[/url
    > Sent: Saturday, November 08, 2003 1:13 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Always wanted to ask this...
    >
    >
    > Why doesnt the stamp support Interrupts?
    >
    > Could someone from parallax also kindly explain.
    >
    > Thanks
    >
    > __________________________________
    > Do you Yahoo!?
    > Protect your identity with Yahoo! Mail AddressGuard
    > http://antispam.yahoo.com/whatsnewfree
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-08 16:17
    Dave,

    What about moving UP to an SX (sold through parallax). Much cheaper than a
    stamp, MUCH FASTER than a stamp (I can make a pin go high for 20 nano seconds)
    and it supports interupts.

    The downside, if you can call it that, is all of the super easy things to do
    with a stamp, like a5 mS pause, as you know, the code is "PAUSE 5" This is
    not so simple with the SX. For example, a 5 uS pause with the sx has to be
    built by "wasting clock cycles" for 5 uS.
    Here is code for the SX to make a 5 uS delay

    ;
    5 uS delay

    del_5uS
    mov w, #$3d
    mov d1, w
    del_5uS_0
    decsz d1
    jmp del_5uS_0
    nop
    nop
    ret


    As you can see, there is a bit more work to make a delay. I believe the basic
    stamp is an excellent device, and works well in many applications but like
    anything, it has limitations.

    Ken

    > Why doesnt the stamp support Interrupts?
    >
    > Could someone from parallax also kindly explain.
    >
    > Thanks

    why not put in your own in the loop ?

    persnoally, I would preferr to not use for-next loops if just running
    thru the program and doing it one step at time will work just as well.

    Dave


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-08 16:21
    As Al mentions, you would need to go to assembly. Not nearly as programming
    friendly as the Basic Stamp, but much cheaper, faster, and the SX chip also
    sold through Parallax supports interupts.

    Ken



    In a message dated 11/8/2003 7:06:26 AM Pacific Standard Time,
    alw@a... writes:
    Interesting enough compilers like PIC Basic Pro have similar problems. If
    you enable their BASIC "interrupts" it is not really interrupts. It checks
    for an interrupt in between each BASIC instruction. If you want real
    interrupts you have to go to assembly.


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-08 17:35
    >Why doesnt the stamp support Interrupts?
    >Could someone from parallax also kindly explain.
    >Thanks

    Parallax addressed this issue somewhat in the BS2p and BS2pe, with
    the polling commands. These are "interrupts" of the sort that Al
    described, that check the state of pins in between each PBASIC
    command. This polling scheme is limited in what it can do, in
    particular, it cannot run a subroutine and then return from interrupt
    to where it left off. It can, however, do a few useful things
    without compromising or complicating the timing of the actual
    interpreted commands. I use the pollwait commands in my programming
    in order to keep the processor sleeping until a timer runs over or
    until an event happens on a pin. Also, I use the pollin commands to
    capture short pulses on pins so that my program can deal with the
    events later without having to check the pins too frequently.

    -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-10 08:50
    Hi,

    I hope I don't offend the moderator too much but you
    may wish to take a look at BASICX. This device is a
    bit cheaper than bigger STAMPs, has twice EEPROM and
    has an OS that supports multitasking and interrupts.
    I've been very happy with a BSP2p which enabled me to
    have a very rapid development time on a project.

    However I have decided to evaluate this device as the
    looping in the project was getting complex to poll
    switches, scroll an LCD module and monitor a rapidly
    switching circuit all at once. The BASIC is not as
    good as pBASIC and doesn't include LCD and I2C support
    - so these have to coded - which is bound to be
    slower. The RTC is a bit of a con as it needs the MPU
    to be running and can be upset by time-critical tasks.
    Also doesn't have raw SX or AVR power. Manuals and IDE
    are on line but are not as easy to use as parallex's -
    eg commands aren't given with real examples and wiring
    set-up.

    Choices, choices.

    Adrian


    =====
    -
    *********************************************

    ________________________________________________________________________
    Want to chat instantly with your online friends? Get the FREE Yahoo!
    Messenger http://mail.messenger.yahoo.co.uk
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-10 15:11
    Adrian,

    I own a couple of BasicX-24. I don't use them. Instead, I use BS2
    and BS2p. Why? BX-24 comes with very poor documentation.

    How did you learn to use the BX-24?


    --- In basicstamps@yahoogroups.com, Adrian <adrian650@y...> wrote:
    > Hi,
    >
    > I hope I don't offend the moderator too much but you
    > may wish to take a look at BASICX. This device is a
    > bit cheaper than bigger STAMPs, has twice EEPROM and
    > has an OS that supports multitasking and interrupts.
    > I've been very happy with a BSP2p which enabled me to
    > have a very rapid development time on a project.
    >
    > However I have decided to evaluate this device as the
    > looping in the project was getting complex to poll
    > switches, scroll an LCD module and monitor a rapidly
    > switching circuit all at once. The BASIC is not as
    > good as pBASIC and doesn't include LCD and I2C support
    > - so these have to coded - which is bound to be
    > slower. The RTC is a bit of a con as it needs the MPU
    > to be running and can be upset by time-critical tasks.
    > Also doesn't have raw SX or AVR power. Manuals and IDE
    > are on line but are not as easy to use as parallex's -
    > eg commands aren't given with real examples and wiring
    > set-up.
    >
    > Choices, choices.
    >
    > Adrian
    >
    >
    > =====
    > -
    > *********************************************
    >
    >
    ______________________________________________________________________
    __
    > Want to chat instantly with your online friends? Get the FREE
    Yahoo!
    > Messenger http://mail.messenger.yahoo.co.uk
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-12 17:39
    It's difficult to explain, even more difficult to do -- which is why
    nobody REALLY does it. What we refer to as "pin polling" (checking
    states between instructions) is what others are okay with calling
    interrupts -- we don't see them as true interrupts and don't call them
    that.

    Let me give you an example. What happens if you're executing this
    command:

    PAUSE 1000

    And 200 milliseconds into the PAUSE something happens. What do you do?
    If your interrupt process takes 100 millisecond (remember, you're
    running BASIC) then is it okay for your PAUSE to be 1100+ milliseconds?
    What if that was controlling a machine and the timing was critical? Do
    you see where I'm going here? So, BASIC is generally not reentrant, so
    not interruptible. In the BS2p we can check pins between instructions
    so that the instruction integrity is maintained. We don't call that an
    interrupt ... others do.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: harshit suri [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=mMbuGKktP4RADOk9Wtwm7RGthKNxw_6QsQNXHnAhCuEYLxwdApjMG-lF6PKbO89G-BADJwas9f1snD5VJg]suri_list@y...[/url
    Sent: Saturday, November 08, 2003 1:13 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Always wanted to ask this...


    Why doesnt the stamp support Interrupts?

    Could someone from parallax also kindly explain.

    Thanks

    __________________________________
    Do you Yahoo!?
    Protect your identity with Yahoo! Mail AddressGuard
    http://antispam.yahoo.com/whatsnewfree

    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-12 19:48
    Why not make an intelligent pause....Just run the checking status for events
    that would require Interrupt. Once the timing was worked out your pause would
    not just pause the processor....you would be busy checking on things while your
    waiting.

    Now during your Main Code segment...that's another matter.

    With 4,000 instructions per second....what would you miss if you looked for the
    event every once and a while....???

    Tim

    >>> jwilliams@p... 11/12/03 11:39AM >>>
    It's difficult to explain, even more difficult to do -- which is why
    nobody REALLY does it. What we refer to as "pin polling" (checking
    states between instructions) is what others are okay with calling
    interrupts -- we don't see them as true interrupts and don't call them
    that.

    Let me give you an example. What happens if you're executing this
    command:

    PAUSE 1000

    And 200 milliseconds into the PAUSE something happens. What do you do?
    If your interrupt process takes 100 millisecond (remember, you're
    running BASIC) then is it okay for your PAUSE to be 1100+ milliseconds?
    What if that was controlling a machine and the timing was critical? Do
    you see where I'm going here? So, BASIC is generally not reentrant, so
    not interruptible. In the BS2p we can check pins between instructions
    so that the instruction integrity is maintained. We don't call that an
    interrupt ... others do.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: harshit suri [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=hztIlZxFQFxtdVMxYE95SHgnG9JOuKYH9bbIY7xnd05nMAskRU4dQ7vhspCOSRLAHHMBEi4K79npN74w8g]suri_list@y...[/url
    Sent: Saturday, November 08, 2003 1:13 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Always wanted to ask this...


    Why doesnt the stamp support Interrupts?

    Could someone from parallax also kindly explain.

    Thanks

    __________________________________
    Do you Yahoo!?
    Protect your identity with Yahoo! Mail AddressGuard
    http://antispam.yahoo.com/whatsnewfree

    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-12 22:18
    The fact is that MANY microcontrollers DON'T have interrupts and
    programmers have happily lived without them for a very long time.
    PBASIC makes it easy to construct a program that "feels" like it's
    handle "interrupts" without doing it. I've shared this structure
    several times, but here goes again:

    Main:
    DO
    GOSUB Do_Something_Important
    ON task GOSUB Task1, Task2, Task3
    LOOP


    The idea is that the "Do_Something_Important" is your background process
    and your tasks are the foreground process. Any of the subroutines can
    update the current task pointer to control the flow of the program. I
    use this structue all the time and it works well -- and is easy to
    manage.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office



    Original Message
    From: Tim Hart [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=eiAMF_KnJoDZhYi8UWKVWGL2jM7jDbsIrU4kGscB737oSA6MJsAJnhkA-RCI4FpFUwW6NtIYUiNHs72sYQ]tim.hart@h...[/url
    Sent: Wednesday, November 12, 2003 1:49 PM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] Always wanted to ask this...


    Why not make an intelligent pause....Just run the checking status for
    events that would require Interrupt. Once the timing was worked out
    your pause would not just pause the processor....you would be busy
    checking on things while your waiting.

    Now during your Main Code segment...that's another matter.

    With 4,000 instructions per second....what would you miss if you looked
    for the event every once and a while....???

    Tim

    >>> jwilliams@p... 11/12/03 11:39AM >>>
    It's difficult to explain, even more difficult to do -- which is why
    nobody REALLY does it. What we refer to as "pin polling" (checking
    states between instructions) is what others are okay with calling
    interrupts -- we don't see them as true interrupts and don't call them
    that.

    Let me give you an example. What happens if you're executing this
    command:

    PAUSE 1000

    And 200 milliseconds into the PAUSE something happens. What do you do?
    If your interrupt process takes 100 millisecond (remember, you're
    running BASIC) then is it okay for your PAUSE to be 1100+ milliseconds?
    What if that was controlling a machine and the timing was critical? Do
    you see where I'm going here? So, BASIC is generally not reentrant, so
    not interruptible. In the BS2p we can check pins between instructions
    so that the instruction integrity is maintained. We don't call that an
    interrupt ... others do.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: harshit suri [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Vpwg8jTxBsXnJ58728EGhtMQBO4XU2q9qodW_czmQn29EH_R0kmjmjZMNLwfJAH0UxnEr4JkcO6G4Q]suri_list@y...[/url
    Sent: Saturday, November 08, 2003 1:13 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Always wanted to ask this...


    Why doesnt the stamp support Interrupts?

    Could someone from parallax also kindly explain.

    Thanks

    __________________________________
    Do you Yahoo!?
    Protect your identity with Yahoo! Mail AddressGuard
    http://antispam.yahoo.com/whatsnewfree

    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-12 23:20
    Hi All,
    I have been using Basic Stamps in industrial machines for a long time and I
    don't miss interrupts at all.

    When I have to wait for something to happen I pause in little bits and take a
    look around and if nothing is happening then pause a little bit longer.


    Enough_Time = (Your Delay Value)
    x = 0 'Clear time counter
    Looking_For_Something_To_Do:
    if x > Enough_Time then Stop_Goofing_Off 'If the time delay is reached Go
    Do Something.
    pause 1 'Wait just a little bit
    If Input 1 (is true) goto Do_Something 'Check for Something to do.
    If Input 2 (is true) goto Do_Something_Else 'Check for Something else to do.
    ... 'Yada
    ... 'Yada
    ... 'Yada
    x = x + 1 'Increment the time counter

    goto Looking_For_Something_To_Do
    In most machinery this simple polling routine may need to be fine tuned for
    timing by changing the value of Enough_Time.
    This is a little bit of brute force, but it allows leaving the loop without
    worrying about If-Then-Next stack errors.
    Most machinery is event driven so when you do something while waiting, and
    event will send you off the waiting task anyway.

    When you go somewhere out of the delay loop it will throw the loop timing
    off.
    If we were really worried about millisecond timing we would bite the bullet
    and spend $2k for the slick PLC unit. But hey for $49 bucks you cant bang any
    more bits than a Stamp2.

    Alan Bradford
    StamPlc.com and PlasmaTechnologies.com





    In a message dated 11/12/2003 12:41:15 PM Eastern Standard Time,
    jwilliams@p... writes:
    It's difficult to explain, even more difficult to do -- which is why
    nobody REALLY does it. What we refer to as "pin polling" (checking
    states between instructions) is what others are okay with calling
    interrupts -- we don't see them as true interrupts and don't call them
    that.

    Let me give you an example. What happens if you're executing this
    command:

    PAUSE 1000

    And 200 milliseconds into the PAUSE something happens. What do you do?
    If your interrupt process takes 100 millisecond (remember, you're
    running BASIC) then is it okay for your PAUSE to be 1100+ milliseconds?
    What if that was controlling a machine and the timing was critical? Do
    you see where I'm going here? So, BASIC is generally not reentrant, so
    not interruptible. In the BS2p we can check pins between instructions
    so that the instruction integrity is maintained. We don't call that an
    interrupt ... others do.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: harshit suri [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=SDT5HPROBBSQhRZHrEdKVkZG1ZC6MZlHiCD4_GLzv6ZAmHzI5AIiFoy9ISVvCfh6xij_3_Pc1AuJGc8]suri_list@y...[/url
    Sent: Saturday, November 08, 2003 1:13 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Always wanted to ask this...


    Why doesnt the stamp support Interrupts?

    Could someone from parallax also kindly explain.

    Thanks


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-12 23:29
    Correct me if I'm wrong, but can't you use the reset button on the BS2 for
    a kind of an interrupt?


    On Wed, 12 Nov 2003, Jon Williams wrote:

    > The fact is that MANY microcontrollers DON'T have interrupts and
    > programmers have happily lived without them for a very long time.
    > PBASIC makes it easy to construct a program that "feels" like it's
    > handle "interrupts" without doing it. I've shared this structure
    > several times, but here goes again:
    >
    > Main:
    > DO
    > GOSUB Do_Something_Important
    > ON task GOSUB Task1, Task2, Task3
    > LOOP
    >
    >
    > The idea is that the "Do_Something_Important" is your background process
    > and your tasks are the foreground process. Any of the subroutines can
    > update the current task pointer to control the flow of the program. I
    > use this structue all the time and it works well -- and is easy to
    > manage.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    >
    Original Message
    > From: Tim Hart [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=JOZdy-UREqjSyItO_RdJSi3mDFIS8yqPNY3FFsdU0NnVaUSKwfBN7AC4SemPzrkCVOGFhjHUkfCIocE]tim.hart@h...[/url
    > Sent: Wednesday, November 12, 2003 1:49 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Always wanted to ask this...
    >
    >
    > Why not make an intelligent pause....Just run the checking status for
    > events that would require Interrupt. Once the timing was worked out
    > your pause would not just pause the processor....you would be busy
    > checking on things while your waiting.
    >
    > Now during your Main Code segment...that's another matter.
    >
    > With 4,000 instructions per second....what would you miss if you looked
    > for the event every once and a while....???
    >
    > Tim
    >
    > >>> jwilliams@p... 11/12/03 11:39AM >>>
    > It's difficult to explain, even more difficult to do -- which is why
    > nobody REALLY does it. What we refer to as "pin polling" (checking
    > states between instructions) is what others are okay with calling
    > interrupts -- we don't see them as true interrupts and don't call them
    > that.
    >
    > Let me give you an example. What happens if you're executing this
    > command:
    >
    > PAUSE 1000
    >
    > And 200 milliseconds into the PAUSE something happens. What do you do?
    > If your interrupt process takes 100 millisecond (remember, you're
    > running BASIC) then is it okay for your PAUSE to be 1100+ milliseconds?
    > What if that was controlling a machine and the timing was critical? Do
    > you see where I'm going here? So, BASIC is generally not reentrant, so
    > not interruptible. In the BS2p we can check pins between instructions
    > so that the instruction integrity is maintained. We don't call that an
    > interrupt ... others do.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: harshit suri [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=_Hcb-JEpobqLtAG9VMlOWLP6Gyu4g5HspJ1kV8C3KIjMdOzI14Onxvqnsj_r8R2ZyiueJQr3B7UP]suri_list@y...[/url
    > Sent: Saturday, November 08, 2003 1:13 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Always wanted to ask this...
    >
    >
    > Why doesnt the stamp support Interrupts?
    >
    > Could someone from parallax also kindly explain.
    >
    > Thanks
    >
    > __________________________________
    > Do you Yahoo!?
    > Protect your identity with Yahoo! Mail AddressGuard
    > http://antispam.yahoo.com/whatsnewfree
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    > This message has been scanned by WebShield. Please report SPAM to
    > abuse@p....
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    > This message has been scanned by WebShield. Please report SPAM to
    > abuse@p....
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >

    Sean T. Lamont, CTO / Chief NetNerd, Abstract Software, Inc. (ServNet)
    Seattle - Bellingham - Vancouver - Portland - Everett - Tacoma - Bremerton
    email: lamont@a... WWW: http://www.serv.net
    "Do not fear mistakes, There Are None" - Miles Davis
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-13 00:09
    You could connect a transistor or FET to the input to allow an external
    reset ... but this is a bit "brute force" and you'll lose all your
    variables as the reset will clear them to zero.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office



    Original Message
    From: Sean T. Lamont .lost. [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=XlUiYSqLfTem26en6MFJjYB034XFAep4-avpqG5eb_S8KhLZ-CiDgAY52NqejczKXWAGJzy1NTD9YdH671E0Aw]lamont@a...[/url
    Sent: Wednesday, November 12, 2003 5:29 PM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] Always wanted to ask this...



    Correct me if I'm wrong, but can't you use the reset button on the BS2
    for a kind of an interrupt?


    On Wed, 12 Nov 2003, Jon Williams wrote:

    > The fact is that MANY microcontrollers DON'T have interrupts and
    > programmers have happily lived without them for a very long time.
    > PBASIC makes it easy to construct a program that "feels" like it's
    > handle "interrupts" without doing it. I've shared this structure
    > several times, but here goes again:
    >
    > Main:
    > DO
    > GOSUB Do_Something_Important
    > ON task GOSUB Task1, Task2, Task3
    > LOOP
    >
    >
    > The idea is that the "Do_Something_Important" is your background
    > process and your tasks are the foreground process. Any of the
    > subroutines can update the current task pointer to control the flow of

    > the program. I use this structue all the time and it works well --
    > and is easy to manage.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    >
    Original Message
    > From: Tim Hart [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=z1kCyKfMtFco51a-nRVCMUx1okg-MRtmWp9u0d7TV0EuCGPrV8PRPKLh7WLrfPWy8at65FOd5iIPEGxcgKE]tim.hart@h...[/url
    > Sent: Wednesday, November 12, 2003 1:49 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Always wanted to ask this...
    >
    >
    > Why not make an intelligent pause....Just run the checking status for
    > events that would require Interrupt. Once the timing was worked out
    > your pause would not just pause the processor....you would be busy
    > checking on things while your waiting.
    >
    > Now during your Main Code segment...that's another matter.
    >
    > With 4,000 instructions per second....what would you miss if you
    > looked for the event every once and a while....???
    >
    > Tim
    >
    > >>> jwilliams@p... 11/12/03 11:39AM >>>
    > It's difficult to explain, even more difficult to do -- which is why
    > nobody REALLY does it. What we refer to as "pin polling" (checking
    > states between instructions) is what others are okay with calling
    > interrupts -- we don't see them as true interrupts and don't call them

    > that.
    >
    > Let me give you an example. What happens if you're executing this
    > command:
    >
    > PAUSE 1000
    >
    > And 200 milliseconds into the PAUSE something happens. What do you
    > do? If your interrupt process takes 100 millisecond (remember, you're
    > running BASIC) then is it okay for your PAUSE to be 1100+
    > milliseconds? What if that was controlling a machine and the timing
    > was critical? Do you see where I'm going here? So, BASIC is
    > generally not reentrant, so not interruptible. In the BS2p we can
    > check pins between instructions so that the instruction integrity is
    > maintained. We don't call that an interrupt ... others do.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: harshit suri [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=JV1CM-caE7JwtMdIGBuytZ8IMiIRIZJW2MyySKIYm9JqbbKyhaERrzLMxPnJ9Sv6xMtA8dxbAjI36C589AA]suri_list@y...[/url
    > Sent: Saturday, November 08, 2003 1:13 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Always wanted to ask this...
    >
    >
    > Why doesnt the stamp support Interrupts?
    >
    > Could someone from parallax also kindly explain.
    >
    > Thanks
    >
    > __________________________________
    > Do you Yahoo!?
    > Protect your identity with Yahoo! Mail AddressGuard
    > http://antispam.yahoo.com/whatsnewfree
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    > This message has been scanned by WebShield. Please report SPAM to
    > abuse@p....
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    > This message has been scanned by WebShield. Please report SPAM to
    > abuse@p....
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >

    Sean T. Lamont, CTO / Chief NetNerd, Abstract Software, Inc. (ServNet)
    Seattle - Bellingham - Vancouver - Portland - Everett - Tacoma -
    Bremerton
    email: lamont@a... WWW: http://www.serv.net
    "Do not fear mistakes, There Are None" - Miles Davis


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-13 15:19
    Well, you can treat Reset as a 'kind' of interrupt,
    but most people treat interrupts
    as something quick, which doesn't clear the entire
    state of the micro, and then have an unpredictable
    time before your program starts running again.

    A Reset is usually considered more of an 'oh-my-god,
    everything is hosed, I need to take this thing back
    to start and begin again' kind of signal. There is
    no way to do a 'reset' then return to your OTHER
    executing code in progress -- what most people
    mean by an interrupt.

    --- In basicstamps@yahoogroups.com, "Sean T. Lamont .lost."
    <lamont@a...> wrote:
    >
    > Correct me if I'm wrong, but can't you use the reset button on the
    BS2 for
    > a kind of an interrupt?
    >
    >
    > On Wed, 12 Nov 2003, Jon Williams wrote:
    >
    > > The fact is that MANY microcontrollers DON'T have interrupts and
    > > programmers have happily lived without them for a very long time.
    > > PBASIC makes it easy to construct a program that "feels" like it's
    > > handle "interrupts" without doing it. I've shared this structure
    > > several times, but here goes again:
    > >
    > > Main:
    > > DO
    > > GOSUB Do_Something_Important
    > > ON task GOSUB Task1, Task2, Task3
    > > LOOP
    > >
    > >
    > > The idea is that the "Do_Something_Important" is your background
    process
    > > and your tasks are the foreground process. Any of the
    subroutines can
    > > update the current task pointer to control the flow of the
    program. I
    > > use this structue all the time and it works well -- and is easy to
    > > manage.
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    > >
    Original Message
    > > From: Tim Hart [noparse][[/noparse]mailto:tim.hart@h...]
    > > Sent: Wednesday, November 12, 2003 1:49 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: RE: [noparse][[/noparse]basicstamps] Always wanted to ask this...
    > >
    > >
    > > Why not make an intelligent pause....Just run the checking status
    for
    > > events that would require Interrupt. Once the timing was worked
    out
    > > your pause would not just pause the processor....you would be busy
    > > checking on things while your waiting.
    > >
    > > Now during your Main Code segment...that's another matter.
    > >
    > > With 4,000 instructions per second....what would you miss if you
    looked
    > > for the event every once and a while....???
    > >
    > > Tim
    > >
    > > >>> jwilliams@p... 11/12/03 11:39AM >>>
    > > It's difficult to explain, even more difficult to do -- which is
    why
    > > nobody REALLY does it. What we refer to as "pin polling"
    (checking
    > > states between instructions) is what others are okay with calling
    > > interrupts -- we don't see them as true interrupts and don't call
    them
    > > that.
    > >
    > > Let me give you an example. What happens if you're executing this
    > > command:
    > >
    > > PAUSE 1000
    > >
    > > And 200 milliseconds into the PAUSE something happens. What do
    you do?
    > > If your interrupt process takes 100 millisecond (remember, you're
    > > running BASIC) then is it okay for your PAUSE to be 1100+
    milliseconds?
    > > What if that was controlling a machine and the timing was
    critical? Do
    > > you see where I'm going here? So, BASIC is generally not
    reentrant, so
    > > not interruptible. In the BS2p we can check pins between
    instructions
    > > so that the instruction integrity is maintained. We don't call
    that an
    > > interrupt ... others do.
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: harshit suri [noparse][[/noparse]mailto:suri_list@y...]
    > > Sent: Saturday, November 08, 2003 1:13 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] Always wanted to ask this...
    > >
    > >
    > > Why doesnt the stamp support Interrupts?
    > >
    > > Could someone from parallax also kindly explain.
    > >
    > > Thanks
    > >
    > > __________________________________
    > > Do you Yahoo!?
    > > Protect your identity with Yahoo! Mail AddressGuard
    > > http://antispam.yahoo.com/whatsnewfree
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the
    Subject
    > > and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    > >
    > > This message has been scanned by WebShield. Please report SPAM to
    > > abuse@p...
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the
    Subject
    > > and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the
    Subject
    > > and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    > >
    > > This message has been scanned by WebShield. Please report SPAM to
    > > abuse@p...
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the
    Subject and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    >
    > Sean T. Lamont, CTO / Chief NetNerd, Abstract Software, Inc.
    (ServNet)
    > Seattle - Bellingham - Vancouver - Portland - Everett - Tacoma -
    Bremerton
    > email: lamont@a... WWW: http://www.serv.net
    > "Do not fear mistakes, There Are None" - Miles Davis
Sign In or Register to comment.