Need hardware 12F675 ADC interrupt


+ Reply to Thread
Results 1 to 2 of 2

Thread: Need hardware 12F675 ADC interrupt1794 days old

  1. #1
    Junior Member Maxi's Avatar
    Join Date
    Mar 2010
    Posts
    93
    Thumbs Up
    Received: 1
    Given: 25
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Need hardware 12F675 ADC interrupt

    this code is working on proteus
    but doesnt work over real circuit.
    program dont go interrupt
    could you help me?



    Device 12F675
    Declare Xtal=4
    Config CPD_OFF,CP_OFF,BODEN_ON,MCLRE_OFF,PWRTE_ON,WDT_OFF ,INTRC_OSC_NOCLKOUT

    TRISIO=000010
    ANSEL =010010
    ADCON0=000111
    CMCON=7

    Symbol GO_DONE = ADCON0.1
    Dim AD_RESULT As ADRESL.Word

    Dim RAW_adc As Word
    Dim TEMP As Word

    Symbol GIE = INTCON.7
    Symbol PEIE = INTCON.6
    Symbol ADIE = PIE1.6
    Symbol ADIF = PIR1.6
    ADIE=1
    GO_DONE=1

    While GIE=1 : GIE=0 : Wend
    On_Interrupt GoTo INT
    PEIE=1
    GIE=1


    LOOP:
    Inc TEMP
    DelayMS 50
    GoTo LOOP


    INT:
    Context Save

    While GO_DONE =1 :Wend
    DelayUS 10
    RAW_adc = AD_RESULT

    ADIF = 0
    GO_DONE=1
    Context Restore

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,168
    Thumbs Up
    Received: 96
    Given: 1
    Total Downloaded
    2.90 GB

    0 Not allowed!

    Default Re: Need hardware 12F675 ADC interrupt

    You would normally place your On_Interrupt declaration in the declarations section rather than mixing it in with the code.
    e.g.

    Code:
    Device 12F675
    Declare Xtal=4
    Config CPD_OFF,CP_OFF,BODEN_ON,MCLRE_OFF,PWRTE_ON,WDT_OFF  ,INTRC_OSC_NOCLKOUT
    
    TRISIO=000010
    ANSEL =010010
    ADCON0=000111
    CMCON=7
    
    Symbol GO_DONE = ADCON0.1 
    Dim AD_RESULT As ADRESL.Word 
    
    Dim RAW_adc As Word
    Dim TEMP As Word
    
    Symbol GIE = INTCON.7
    Symbol PEIE = INTCON.6
    Symbol ADIE  = PIE1.6
    Symbol ADIF  = PIR1.6
    
    On-Interrupt GoTo Int
    
    ' here you can set your variables
        
    JohnB

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. Using ADC for 12f675 servo slow circuit
      By plane spotter in forum Proton Plus Compiler v3
      Replies: 1
      Last Post: 25th October 2008, 14:13
    2. Interrupt Hardware
      By fgcity in forum Proton Plus Compiler v3
      Replies: 14
      Last Post: 20th August 2008, 15:24
    3. [SOLVED !] Button using hardware interrupt - how to debounce?
      By HelpMe! in forum Proton Plus Compiler v3
      Replies: 9
      Last Post: 17th June 2008, 20:06
    4. [SOLVED !] Hardware interrupt anomalies
      By Latex in forum Proton Plus Compiler v3
      Replies: 6
      Last Post: 17th December 2007, 17:39
    5. 4520 Hardware Interrupt
      By normnet in forum Proton Plus Compiler v3
      Replies: 6
      Last Post: 28th June 2006, 08:02

    Tags for this Thread

    Posting Permissions

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