Shop OBEX P1 Docs P2 Docs Learn Events
Interrupt handling. How use the interrupt pins on the SX-processor from BSsx? — Parallax Forums

Interrupt handling. How use the interrupt pins on the SX-processor from BSsx?

J.WeJ.We Posts: 15
edited 2005-08-16 12:27 in BASIC Stamp
I·use a BSsx, with UBICOM sx processor, it is a powerful processor with 8 pin interrupt and own interrupt stack. I want to use them!· What I can see, you cannot get to the interrupt pins on the processor from the BSsx. Is there any BASIC STAMP module who can handle interrupts?
Regards//Johan
·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-09 11:27
    No; the PBASIC interpreter does not do interrupts.·

    If you want to use interrupts you can program "plain" SX chips with the SX/B compiler (it's very close to PBASIC) and SX/B does allow interrupt programming.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-08-09 11:56
    The BS2p variants do have a "Basic" interrupt, which allows you to check interrupt statuses between PBasic tokens. However, the BS2sx has an SX built into it as a run-time engine. It's intended to run the PBasic op-codes, which do not support assembly level interrupts. And you're not allowed to 'tweak' the PBasic run-time to support them either. So no, you can't use the interrupt features of the SX on the BS2sx.

    Note that 'tweaking the PBasic run-time' is a non-trivial exercise, in fact that's what Parallax has built their company around.

    Now, what Jon is saying is that Parallax does sell a $100 package that lets you program SX chips yourself -- along with a very nice SX/B IDE/compiler that lets you have a mix of Basic and Assembly. They also sell $10 SX48 and SX52 boards, which are VERY nice. So you could easily go that route.
  • BeanBean Posts: 8,129
    edited 2005-08-09 12:25
    Johan,
    Can you tell us what you need interrupts for ? Maybe there is a way to do it with some external circuit.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"
    ·
  • J.WeJ.We Posts: 15
    edited 2005-08-12 09:21
    Thank you for your kind support (as always)!

    Bean,
    I want to use the interrupt as the same way as for a microprocessor, when condition/state is changed,·physically (on a pin) or logically (RS232-register flag), the program will·branch to a interrupt routine.

    What can I do with my BS,(BSp) can I use Polling (POLLMODE, POLLIN, POLLOUT) for this?

    Regards//J.We
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-12 15:32
    Pin polling only works with a change of pin state, and this feature is only available on the BS2p family (BS2p, BS2pe, BS2px). And, it does not cause a branch to a interrupt routine per se. There is a POLLRUN instruction that can cause the program to RUN another program bank, but you will not automatically be returned to the point where you were called.

    This is why I don't like to call pin polling "interrupt" because it does not work like standard microcontroller interrupts and I think that's really what you're looking for. For that, you can use your PBASIC skills with SX/B (our free BASIC compiler for the SX micro [noparse][[/noparse]not BS2sx]).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • J.WeJ.We Posts: 15
    edited 2005-08-16 09:40
    Ok, Thanks!
    I will try to get around my problem in some other way.
    ·
    My original problem had to do with buffering. I control my BS with a java program witch constantly sending commands to my BS via RS232. I didn’t want to “loose” instructions because BS didn’t have buffering ore interrupt handling and only is able to do “one thing at the time”. The problem is totally my fault, and I should have looked these things up more carefully before I started my project.
    ·
    But ok, anyway, I will try to program my BS so that it doesn’t matter if it misses some commands..
    ·
    Thank you !
    ·
    Regards//Johan
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-16 12:27
    One thing you could do is use flow control so that the BASIC Stamp lets the other device know that it is ready to receive serial data.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.