[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Reading data from parallel port


I am not sure which signals you are trying to read but
any signal on the parallel port can be read with:

(*R_PAR0_STATUS_DATA) & signal_mask
((*R_PAR0_STATUS_DATA) & (1 << signal_bit))>>signal_bit

e.g. the data pins can be read by (*R_PAR0_STATUS_DATA)&0xff
and the SELECT signal can be read with

Hope this helps

-----Original Message-----
From: Sam Cheng [mailto:pscheng@xxxxxxx.hk]
Sent: Sunday, April 22, 2001 8:38 AM
To: starvik@xxxxxxx.com
Cc: dev-etrax
Subject: Reading data from parallel port

    I have a device that I will send some singal to it and receive data
from the datapin of the parallel port0.

    I found that the signal of the data pin is high in the CRO but I can't
read the data inside the program. It always return zero.

    I use manual mode for the parallel port0 and how can I read the data?
    I have try to use
         chr = (R_PAR0_STATUS_DATA << 24) >> 24
    or   chr = (R_PAR0_CTRL_DATA << 24) >> 24 to get the data.
    But the variable "chr" always return zero value from data pin.

    When i try to get the data from pin31-8. It return correct result.
    It seems that I only can't get the data from pin7-0 although I can see
the high signal from the CRO.