pc386 LPT question

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Thu Dec 1 21:18:09 UTC 2005


Thanks.  I will assume this is the way the code needs to do it and
write to that.  But I will have to try this once the track is taken down 
from the school's attic. :(

And .. yes.. this is a completely voluntary effort so we can have
times on the track again. The inside joke in Scouting is that it
just takes one hour a week. :)

--joel

Camilo Alejandro Arboleda wrote:
> Data register: BASE_ADDRESS + 0x00
> Status register: BASE_ADDRESS + 0x01
> Control register: BASE_ADDRESS + 0x02
> 
> LPT1 is usualy at BASE_ADDRESS 0x378, so you could use:
> 
> char status;
> inport_byte(0x379, status);
> 
> 
> Status register bits:
> 7 *BUSY
> 6 *ACK
> 5 NO_MORE_PAPER / *PAPER
> 4 ONLINE/*OFFLINE
> 3 *ERROR
> 
> Control register bits:
> 4 IRQ_ENABLED
> 3 PRINTER_SELECTED
> 2 *INITIALIZATION
> 1 AUTOMATIC_LINE_FEED
> 0 STROBE
> 
> 
> 
> 
> Joel Sherrill <joel at OARcorp.com> wrote:
> 
>>
>> Hi,
>>
>> I finally have the old software for our scout's pinewood derby
>> timer and it is a DOS program using a BIOS call to read the printer
>> status.
>>
>> The macro to read the status of the starting gate and finish
>> looks like this:
>>
>> #define         START_GATE              (0x80)
>> #define         ALL_LANES               (0x70)
>> #define         LANE_2                  (0x40)
>> #define         LANE_1                  (0x20)
>> #define         LANE_3                  (0x10)
>>
>> /* bit #3 in the printer status regiser is connected to the start gate */
>> #define GATE_POSITION \
>>     (_bios_printer(_PRINTER_STATUS,0,uiDummy) & START_GATE)
>>
>> /* define macro to test if a car has crossed the finish line */
>> #define FINISH_STATUS \
>>    (_bios_printer(_PRINTER_STATUS,0,uiDummy) & ALL_LANES)
>>
>> Does anyone know how to get the same information with or without a 
>> BIOS call using the pc386 BSP?
>>
>>
>> Please... Thanks. :)
>>
> 


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the users mailing list