Shop OBEX P1 Docs P2 Docs Learn Events
SX/B Asychronous interrupt? — Parallax Forums

SX/B Asychronous interrupt?

SpillerSpiller Posts: 52
edited 2009-01-06 14:45 in General Discussion
Hi All,

I like to use SERIN command inside an asynchronous interrupt routine. ISR run on PORTB interrupt.
The IT pending comes well, but the SERIN command not got we value which i have transmitted.
Can I us SERIN in an asynchronous ISR? Or I should build this serial in receiving in assemby?
Any suggestion? What can be the problem?

Best Regards, a Happy New Year!

Spiller

Comments

  • BeanBean Posts: 8,129
    edited 2009-01-05 11:31
    Spiller,
    It should work fine.
    Are you using OSC4MHZ on the device line ? If so then that is the problem. The internal 4Mhz clock is not accurate enough for serial communications.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ·The next time you need a hero don't look up in the sky...Look in the mirror.


    ·
  • SpillerSpiller Posts: 52
    edited 2009-01-05 13:12
    Hi Bean,

    Thanks, I used internal 4Mhz. I will try it with OSC4MHZ.


    Spiller
  • BeanBean Posts: 8,129
    edited 2009-01-05 13:48
    You mean WITHOUT OSC4MHZ ???

    You'll need to use an external resonator for serial communications.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ·The next time you need a hero don't look up in the sky...Look in the mirror.


    ·
  • SpillerSpiller Posts: 52
    edited 2009-01-05 17:06
    Of course, thanks

    Spliller
  • JonnyMacJonnyMac Posts: 9,214
    edited 2009-01-05 18:18
    Are you using the start bit to initiate the Port B interrupt? If so, SERIN may not work as it will want to wait for the transition at the front side of the start bit. If you are in fact trying to use the start bit to trigger the ISR you're probably better served using an interrupt-driven UART.
  • SpillerSpiller Posts: 52
    edited 2009-01-06 06:44
    Hi JonnyMac,

    What kind of start bit do you mean? Do you mean the Port B interrupt pending bit, or what? Please send me more detailed information.

    Thanks

    Spiller
  • JonnyMacJonnyMac Posts: 9,214
    edited 2009-01-06 14:45
    Perhaps it would help for you to explain your your circuit/code was doing. I was guessing that you didn't want to miss a serial byte so you had setup the interrupt to trigger on a port b edge, the edge being the start bit from the incoming byte.
Sign In or Register to comment.