Beginner in need of help !!


Results 1 to 40 of 72

Threaded View

  1. #11
    Join Date
    Jan 2015
    Posts
    45


    Did you find this post helpful? Yes | No

    Default Re: Beginner in need of help !!

    Hi Tabsoft,

    Right I have changed the bits in the VRCON to the right stuff, so I think that is right now. I did change bits in the CMCON0 but none of it seemed to make a difference, so I have put it back to how it was. I'm thinking either I'm testing the wrong bit still or my actual hardware setup is wrong.

    Maybe you can point something out?

    BTW I am using the low range Also this is correct - As I understand you want to check the input pin voltage against your "1.1" reference you are setting up internally and have the following outcomes: If the input is "Lower than 1.075 Vdc" you want the LED to be OFF and you want the LED to be "ON when the input is Higher than 1.075 Vdc".

    Code -

    Code:
    'PIC 12F683
    
    
    #CONFIG 
       __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF
    #ENDCONFIG
    
    
    DEFINE OSC 4 '4mhz ocsillator
    ANSEL = %00000010 'pin 6 analog
    CMCON0 = %00000100 'comparator mode
    VRCON = %10101000 'voltage reference
    TRISIO = %00000010 'pin 6 input
    
    
    POT1 VAR CMCON0.2 'pot pin 6
    LED VAR GPIO.2 'led pin 5
    
    
    PAUSE 20
    
    
    main:
    IF POT1 = 1 THEN 
    HIGH LED
    ELSE
    LOW LED
    ENDIF
    GOTO main
    Thanks again,
    Rob
    Last edited by robbo78; - 25th January 2015 at 12:59.

Similar Threads

  1. Beginner help!
    By Recognize in forum General
    Replies: 14
    Last Post: - 26th April 2012, 15:55
  2. pic24 beginner
    By robertpeach in forum General
    Replies: 23
    Last Post: - 13th August 2009, 12:57
  3. need help! to beginner
    By emilhs in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 6th May 2009, 19:44
  4. Beginner at PB
    By alphahr in forum Off Topic
    Replies: 1
    Last Post: - 21st April 2008, 18:43
  5. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 6th May 2005, 00:29

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