Comparators on 18F4520


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Posts
    2

    Default Comparators on 18F4520

    I'm just doing a little experimenting and would like to test out the comparators on an 18F4520.

    I don't need an interrupt or a internal reference voltage, I just want a zero-crossing-detector on comparator 2 and be able to view the results on my o-scope.

    I'm starting to wonder if the comparator 2 output is even available on a pic pin ? It's labeled C2OUT, and the datasheet shows RA5 as C2OUT, but I'm not seeing any action on that pin.

    The circuit :



    The input / output (this is what I'm reading on the PIC pin RA1 and output on RA5)



    Thanks .. please convey if you have any idea why I'm not seeing a nice square wave on RA5 of the pic !

  2. #2
    Join Date
    Aug 2009
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    Ok it's fixed, info for the archives :

    I had set the comparator mode wrong. 010 is "two independent comparators". 011 is "two independent comparators WITH OUTPUTS"

    I have no idea how I overlooked that for 2 full days.

    <sigh>

Similar Threads

  1. Bootloader For 18F4520
    By isaac in forum mel PIC BASIC Pro
    Replies: 36
    Last Post: - 24th March 2010, 18:56
  2. communication of pic 18f4520 and cell phone
    By Alisha in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 12:47
  3. Usart compile errors 18F4520
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 7th May 2009, 00:13
  4. Changes 18F452 now use 18F4520
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th October 2008, 16:39
  5. 16F88 using comparators AND the adc
    By jpeakall in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th May 2005, 02:08

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