Parallel port transfer

Discussion in 'Programmer's Corner' started by auststud, Mar 25, 2009.

  1. auststud

    Thread Starter New Member

    Mar 25, 2009

    Even, I have to do the same as what u have to do. I want to send the analog to digital converted data from PIC16F877 to computer through the parallel port.

    I am connecting temperature sensor, LM35 to pin AN0 of PIC16F877, and I want to see the result of ADC on the computer and not on the LCD. I have the setup to read from parallel port, but I dont know, which Ports of PIC16F877 will have the converted data.

    I am using picbasic pro to program the microcontroller. The program, I have written is shown below:


    define ADC_BITS 8
    define ADC_CLOCK 3
    define ADC_SAMPLEUS 50

    x var byte
    y var byte
    z var byte

    pause 500

    ADCIN 0,x
    x = x * 100

    output PORTB
    pause 500
    goto loop

    I want to know, by writing 'output PortB', will all the ports of PortB have 8 bits converted data???

    If it is wrong, how should I send the result of conversion to any port? I mean, what modification should I do in the program???

    From LM35, I am getting 0.25V(as it gives 10mV/C) according to the room temperature. I am multiplying by 100 to read the temperature on the computer.

    Plz help...

    Thanx a lot......

    May God bless u all.........
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    We ask that people not post into existing threads, as it creates confusion.

    This is the hijacked thread -

    I am pretty ignorant of PIC's, but I would imagine that the operations -
    - are going to alter the value of x. What is the purpose?

    Also, do you have to explicitly transfer the variable x to the port in order for the data to get sent?

    Reading the manual for the PIC will answer your questions. Or you can just examine the value of x and the value in the port register to see if the transfer got accomplished.