Help with ADC conversion


Closed Thread
Results 1 to 7 of 7

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    That will be hard to setup PIC18F1320 analog comparator, as he don't have any BUT... PIC18F2220 and lots other have some already built-in.

    Internal analog comparator works as regular voltage comparator (LM393 and so on), you set a voltage reference on one input pin (voltage divider, trim pot, whatever else fancy stuff), and you apply your signal on the other input pin, then you just monitor the voltage comparator output.

    In a PIC, when the output of the comparator change, it can trigger an interrupt event, so it's done in background. Once in the Interrupt handler, you do what you need to do.

    Have a look at Darrel's Instant interrupt, this will save you some headaches. There's also some code-example on how to use'em with Timer.
    http://www.pbpgroup.com/modules/wfse...p?articleid=19

    From there, you should be able to begin some experiments.
    Last edited by mister_e; - 1st February 2009 at 19:29.
    Steve

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

  2. #2
    Join Date
    Oct 2008
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Hey Steve,

    I was just check'n to see if you would catch that............not.

    Anyway, I do have a couple of 18F2550 which look like they have the analog comparators. After looking at THAT datasheet, things are becoming a little more clear. I think I actually might be able to put something together. Thanks for the help and hopefully you can stand by as I try to get this to work.

    Thanks, Don

Similar Threads

  1. Can't get ADC to loop
    By TravisM in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th October 2009, 15:33
  2. A/D conversion with PIC18F67J50
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 01:48
  3. ADC conversion trouble
    By PICante in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 30th April 2008, 20:42
  4. ADC problem with PIC16F917
    By eetech in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th March 2007, 21:22
  5. ADC problem
    By NacNud in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th December 2004, 02:27

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