Shop OBEX P1 Docs P2 Docs Learn Events
Interupts/Polled I/O — Parallax Forums

Interupts/Polled I/O

DGiudiciDGiudici Posts: 10
edited 2005-10-02 12:45 in BASIC Stamp
While playing around with my BS2 I found out that it can not handle interupts or polled I/O. I am sure there are some ways around this, if anybody has any suggestions please tell me.

My application is to shut off my project remotley, because this shut off is going to be used as a "kill switch" or emergency stop i need it to be happen as soon as i press the remote (or soon after).

Cheers

DG

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-02 01:53
    You could always use the RST pin. This pin is pulled-up on the module and if connected to ground will put the BASIC Stamp into reset -- stopping it in its tracks. Note that in reset, all pins floats so your circuit should be able to deal with this.

    Othewise you can construct your code so that the emergency input is scanned periodically and handled. PBASIC has programming contructs that make this possible with very elegant code. The attached framework should help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • DGiudiciDGiudici Posts: 10
    edited 2005-10-02 02:56
    so to make sure i am reading the code correctly... the "critical task" subroutine checks for the interrupt condition ie if a pin is high or something?... and bassed on its return values (setting taskCntrl to 0 -3 ) will do specified tasks?

    Its good to hear that I can manuver around this, I was thinking about upgrading my stamp to maybe the BS2p, so I could do polled I/O. Would there be an advantage to upgrading, except for saving code?

    Cheers

    DG
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-02 03:44
    Yes, you understand the code. If you analyze it carefully you'll see that Critical_Task is interleaved between the other (operational) tasks -- this lets you check the input frequently.

    Aside from extra speed and polled input pins, the BS2p is faster and has lots of other features (I2C, 1-Wire, LCD, etc).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • DGiudiciDGiudici Posts: 10
    edited 2005-10-02 06:27
    thank you for your help...
  • DGiudiciDGiudici Posts: 10
    edited 2005-10-02 07:38
    also i was wondering if there is a way to hook up the bsp 40 stamp up to the board of education? or is the professional development board the only board that the bs2p 40 fits on?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-02 12:45
    If you want to use something smaller than the PDB, you can use the BS2p24/40 demo board:

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

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