i2cread and timer0 interrupt


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2010
    Posts
    5

    Default i2cread and timer0 interrupt

    Hi everyone,

    I'm running PBP 2.47 on a 16F887 and have a problem with a timer0 interrupt.

    It seems that if the timer0 interrupt happens during an i2cread the handler doesn't get executed until after the i2cread finishes (I'm concluding this based on looking at pin levels on a scope so am pretty confident about this). Does i2cread either 1) disable interrupts or 2) use timer0?

    many thanks,

    ...rob

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I2CREAD does not disable interrupts or use Timer0. If you're using ON INTERRUPT, whatever command is executing at the time of the interrupt will complete first, then the interrupt is serviced.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Apr 2010
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    I2CREAD does not disable interrupts or use Timer0. If you're using ON INTERRUPT, whatever command is executing at the time of the interrupt will complete first, then the interrupt is serviced.
    Ah, thanks very much for this. I should have read the manual a bit more carefully as it's pretty clear when you look. I'd assumed the picbasic commands were interruptable when you used on interrupt but I'll need to code the interrupt in assembler I think for that to happen.

    thanks again,

    ...rob

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Rob,

    You can also use DT_INTS if you prefer not to write any assembler.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Apr 2010
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    Thanks for the DT_INTS tip - it looks good!

    ...rob

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts