on interupt with pic 16F619


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Location
    NC, USA
    Posts
    53

    Default on interupt with pic 16F619

    I am trying to figure out how to do a interupt. How do I do an interupt on an I2C Flag? I have tried this, but its not working. Thanks, Charlie

    on Interrupt goto myint
    intcon = PIR1.3 'SSPIF


    myint:
    disable
    INTCON.1 = 0 'disable interupt
    'do stuff
    enable
    resume

    Thanks,
    Charlie

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Have a look at the example provided in the manual, even if they don't use the same interrupt source, this should give you some tips.

    You could still do a search with ON INTERRUPT within this forum.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Aug 2005
    Location
    NC, USA
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    I have searched around some and found some good tips, but have not been able to find the exact interupt I am wanting to do. I have changed the interupt code based on the examples, but I am still not getting the interupt to trigger off the I2C interupt. Thanks, cp

    on Interrupt goto myint
    INTCON.6 = 1 ' PEIE = Peripheral Interrupt Enable bit
    PIR1.3 = 1 ' I2C interrupt enable
    enable

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Check once again all peripheral register and also the MSSP section of your datasheet, maybe you have to select a specific mode in X register(s)... 7 bits+start/stop int or something like that.

    More tha often the datasheet will give you some tips how to set/use int flags.

    I never dared to open your datasheet to check it
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Aug 2005
    Location
    NC, USA
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    I have read the data sheet and can't seem to find anything. I noticed some other chips have a SSPCON2 register, bit 7 looks like what I need.

    GCEN: General Call Enable bit (In I2C Slave mode only)
    1 = Enable interrupt when a general call address (0000h) is received in the SSPSR
    0 = General call address disabled

    The 16F819 does not have this register. I am stuck with the 18 pin interal osc with some analogs and I2C form, but I would really prefer getting the 16F819 working with an interupt. I have an 16F88, but that also does not have the SSPCON2 register either...

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  3. Replies: 2
    Last Post: - 4th January 2009, 23:35
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

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