Pic12f683, Trisio, High Z, A2d


Results 1 to 10 of 10

Threaded View

  1. #1

    Default Pic12f683, Trisio, High Z, A2d

    Hello to all,

    I have a little problem on the 12F683. I want to get the pin GPIO.0 to switch from a LOW state (GND) to a High impedence state (High Z) and while in High Z take an anolog to digital conversion at GPIO.4.

    The problem with the current circuit and Code that i have (attached is a schematic and sample code) is that while in in the LOW State the A/D will be normal and read normal voltage. However, in the HIGH Z state the PIN GPIO.4 (or AN3) will jump to a HIGH state (i.e to VDD).

    Does anyone have any suggestions on how I can go about achieving this task? Maybe another way of switching from High Z to Gnd? Any help would be greatly appreciated.

    Sammple Code:

    'Define ADCIN parameters
    Define ADC_BITS 10 ' Set number of bits in result
    Define ADC_CLOCK 3 ' Set clock source (3=rc)
    Define ADC_SAMPLEUS 50 ' Set sampling time in uS
    Define OSC 4 'define oscilator
    Volt VAR WORD
    main:
    TRISIO = %010000 'Set GPIO.0 as OUTPUT
    LOW GPIO.0 'GND STATE
    Pause 5000
    TRISIO = %010001 'Set GPIO.0 as input (HIGH Z State)
    pause 4000
    ADCIN 3, Volt
    if Volt >= 970 then loop
    pause 1000
    goto main

    loop:
    goto main
    END

    Schematic Attached:
    Thank You All!
    Attached Images Attached Images  

Similar Threads

  1. SERIN MIDI out of Synch?
    By jncortes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th June 2009, 20:08
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. confused problem with interrupt in a working program
    By illuminator4 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th November 2008, 17:01
  4. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37
  5. Serin and TMR0
    By capitano in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th May 2006, 14:58

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