Serial output problems...


Closed Thread
Results 1 to 2 of 2
  1. #1
    jesterhoz's Avatar
    jesterhoz Guest

    Angry Serial output problems...

    Hello all,

    We are trying to do a simple A/D conversion using a Pic16f877a chip. Our code is as follows:

    ------------------------------------------

    Include "modedefs.bas"

    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50

    adcVar var byte ' Create variable to store result
    Init:
    'PortB=$00
    TRISB = %00000000
    TRISA = %11111111
    ADCON1 = %10000010

    main:
    ADCIN 0, adcVar ' Read channel 0, store in adcVar

    serout2 portC.6, 16468, [ adcVar ] '16468 = N9600
    Pause 100
    goto main

    -----------------------------------------

    But, for some reason, our output is not varying along with the analog input from the potentiometer we are reading from.

    Anyone have any ideas?

    Thanks,

    Trevor

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


    Did you find this post helpful? Yes | No

    Default

    Left justify for 8-bit A/D. ADCON1 = %00000010.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Probblem in reading serial output
    By hjcool in forum Serial
    Replies: 0
    Last Post: - 6th August 2009, 10:29
  2. PIC18F4680 to PC via MAX232 (RS232 serial) no output
    By opticsteam1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th April 2008, 20:39
  3. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46
  4. HSEROUT Newbie question/problem
    By Mark Scotford in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 11th July 2006, 14:44
  5. Replies: 2
    Last Post: - 20th January 2006, 21:09

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