"Analogue" interrupts


Closed Thread
Results 1 to 3 of 3
  1. #1
    anj's Avatar
    anj Guest

    Default "Analogue" interrupts

    Gday all
    Is it possible to put a 12F675 to sleep and then wake it up when the value on an analogue input changes ( either up or down from the setting when the pic was put to sleep ).
    I am controlling the speed and direction of a DC motor from a single pot, using the ADC to tell me speed and direction. When the pot is centered, the motor stops, and as such i cant use the comparator interrupt functions as i dont know which way the user will turn the pot. I know i can do it with external circuitry ( or with two comparators ) but was wondering if there is some sneaky interrupt settings i could use to do this in the 12F675.
    ps Mel i'm now up to speed on 12F675 comparators, after my last little exercise, but cant see a way to do it.

    Andrew

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


    Did you find this post helpful? Yes | No

    Default

    The only things that will wake a PIC are interrupts. They are detailed in the 'Special Features of the CPU' section of the PIC's Datasheet. If you now want the PIC to perform decisions based on the ADC value, it needs to be awake to do this - that's the whole reason you're waking it. After-all, if you need to make a decision isn't it best to make it when you're awake? You will need some external hardware (even if it's just a simple Hall-effect switch on your motor) that will kick the PIC awake if the motor turns whilst it's asleep - or as you rightly say, use a PIC with a couple of Comparators.

    Mind you... you can get away with one comparator... feed your input voltage through a Capacitor to remove the primary 'nominal' DC component, then full-wave rectify, and feed that into the Comparator. If then the input voltage goes up or down from the 'nominal' value you can have the comparator detect that a movement has occurred (after all the comparator is simply looking for a voltage above it's reference threshold) and wake the PIC.

    Melanie

  3. #3
    anj's Avatar
    anj Guest


    Did you find this post helpful? Yes | No

    Default

    Gday Mel
    Thks for the reply.
    I am running a system off a battery so am looking at all ways to reduce the power. And avoid external circuits that draw power.
    I understood the interrupt concept so was going to run my ADC on input pin 0 or 1. Doing this i could reset to analogue, initialise the comparator, then put the chip to sleep. When the analogue comparator interrupt wakes it up, i reset to digital and do my ADCs. ( but this requires two comparators ).
    A bandpass type interrupt on a single pin would be a really nice feature.
    Re hall effect. Wont work. The chip feeds the PWM to drive the motor, and the chips asleep :-)
    Re yr last solution, i am reading a pot supplied via the PIC supply rail, hence its pure DC already. Nothing to rectify.

    Andrew
    Last edited by anj; - 2nd April 2004 at 23:28.

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  3. Microcode studio - PIC16F877A Interrupts
    By mcbeasleyjr in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th January 2009, 06:10
  4. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  5. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10

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