Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Thank you for your help and patience !

  2. #2
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Can somebody help me with this code for 12F683: ?

    I want to blink very quikly a led in background ,independent of my code, random, pause between 1-20 ms. I think that this interval is ok, the best if its possible to set pause limits.
    I want learn about intrerupts but i think that I'm too old ...

    thx in advance !!

  3. #3
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    ...or , how I can make SPWM without intrerupts...?

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Quote Originally Posted by midali View Post
    ...or , how I can make SPWM without intrerupts...?
    Darrel came up with a terrific piece of code for my project - have a look at this thread:

    http://www.picbasic.co.uk/forum/showthread.php?t=17299

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,627


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Hi,
    I guess you COULD use ADCIN but it kind of defeats the purpose of the interrupt since it is a self timed command.

    When using ADC interrupts you basically set the GO/DONE bit to start the converstion and the interrupt fires when the ADC conversion is done. If you then use ADCIN in the interrupt handler it would perform another, self-timed, conversion which, again, kind of defeats the use of interrupts in the first place.

    The idea is to start the conversion and then either go to sleep or go do something important while the ADC does its job. The interrupt fires when the conversion is complete and you go grab the result by reading ADRESH/ADRESL register pair.

    /Henrik.

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Thanks Henrik. I've never done A/D conversion before other than through ADCIN but I guessed it wouldn't make sense to use in an interrupt. I'll have to do a search on 'ADRESH' to see how to read the result when I turn the trim pot dial.

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    I've set up and ADC interrupt using DT_INST-14 with the following handler code:

    Code:
    ' ***************************************************************
    ' [A/D - interrupt handler]
    ' ***************************************************************
    ADC_change:
      PAUSEUS 50              ' Wait for A/D channel acquisition time
      ADCON0.1 = 1           ' Start conversion
      WHILE ADCON0.1       ' Wait for it to complete
      WEND
      ADCInVal = ADRESH
    
    @ INT_RETURN
    Is that right? I just need 8-bit ADC resolution (0-255)

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Quote Originally Posted by midali View Post
    I want to blink very quikly a led in background ,independent of my code...I want learn about intrerupts but i think that I'm too old...
    Try this as an intro to Darrel Interrupts and blinking LED:
    http://darreltaylor.com/DT_INTS-14/blinky.html

    It's worth the time to practice. His routines make things so much easier and flexible later on as you add more complexity to your code.

    Robert

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 07:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04:11

Members who have read this thread : 6

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

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