With the discussion on printer port interface, I thought I'd pass along my code for the PIC (16c74a) to write data to the printer port in nybble mode. In my application, the PC reads from the PIC in nybble mode (slow, but always works) and writes to it just using the printer port -strobe signal to drive the -write input of the PIC PSP. For more info on timing, etc., see http://www.dovesystems.com and look under StarPort. Harold writeNybble ; This routine takes data from the RamPort and sends it to the host processor. ; Called from main loop cblock wnState ; Write Nybble state wndata ; Byte from RamPort we're transmitting endc movlw high(writeNybble) movwf pclath ; Get ready for jump table movfw wnState ; Get state andlw 0x07 ; Prevent some invalid states addwf pcl,1 ; Go into jump table goto wn0 ; 0 - Waiting for -DataRq to go low goto wn1 ; 1 - Low half sent to host, waiting for -DataAck to go low goto wn2 ; 2 - Waiting for -DataRq to go high goto wn3 ; 3 - Waiting for -DataRq to go low for high half goto wn4 ; 4 - High half sent to host, waiting for -DataRq to go high goto wn5 ; 5 - Invalid state, clear state and return goto wn6 ; 6 - Invalid state, clear state and return goto wn7 ; 7 - invalid state wn0 ; Waiting for -DataRq to go low btfsc porta,4 ; test bit return ; if not yet low, return movfw hostReadAddressHi ; Set up RamPort address disableIRQ ; RamPort code not reentrant movwf ReadAddressHi movfw hostReadAddressLo movwf ReadAddressLo call ReadRamPort ;read it movfw ReadData ; get results enableIRQ ; irq ok now movwf wnData ; and save it iorlw 0xf0 ; Set high half so we don't make -DataAck low right away movwf porta ; Output the data andlw b'11011111' ; Set bit 5 (-DataAck) low movwf porta ; and output the updated port data, avoiding read-modify-write! incf wnState,1 ; Go wait for -DataRq to go high ; return wn1 ; Waiting for -dataRq to go high btfss porta,4 ; test bit return ; Exit if host has not yet taken nybble bsf porta,5 ; Set the ack bit high incf wnstate,1 ; and move on ; return wn2 ; Waiting for -DataRq to go low again btfsc porta,4 ; test bit return ; Exit if host has not yet requested high half of nybble swapf wndata,0 ; Put high half in low half of w iorlw 0xf0 ; Set high half high so we don't make -DataAck low right away movwf portA ; output the data andlw b'11011111' ; Set bit 5 (-DataAck) low movwf portA ; and output it, avoiding read-modify-write of bcf incf wnState,1 ; move on to next state ; return wn3 ; Waiting for -DataRq to go high btfss porta,4 ; test bit return ; Exit if -DataRq has not yet gone high bsf porta,5 ; Set -DataAck back high movlw 1 ; Increment address after read addwf hostReadAddressLo,1 ; Add 1 to lo half, setting carry if needed btfsc status,c ; overflow? incf hostReadAddressHi,1 ; Yes, add carry to high half wn4 wn5 wn6 wn7 clrf wnState ; Invalid states, clear and return return