> Hello PICcers,
>
> I am planning a project, where a PIC has to communicate with a PC.
> Normally, you would use the serial port or any other standard ports of a
> PC to build up a connection with a PIC. But I thought to (ab)use only one line
> of the parallel port for the communication (and of course a ground line) - and
> the parallel port should still be used for the printer:
>
> The parallel port of a PC has a line called 'Autofeed'. If activated, the
> printer automatically adds a line-feed, when it receives a carriage return.
> Since this function is not needed normally, I thought of setting the line to
> an appropriate voltage level on the printer's side, and use this line instead
> for communication with my PIC.
> This autofeed line of the parallel port has the advantage, that it can be
> programmed to be an open collector output or an input (as far as I think to
> know).
>
> The PC should send a command to the pic via the line, and the pic should reply
> with a status message. So the data transfer goes in both directions, a message
> will consist of about 3-30 bytes.
>
> I still have some doubts, if this kind of interface would work. I have not
> made any experiments yet, but I hope that someone can give me an answer or a
> comment to the following questions:
>
> What would be a suitable transfer protocol? The PC-control-program (it
> will be a plain DOS-program) has to program the port line directly and
> therefore needs a reliable time base. Can a PC-timer be used for this purpose:
> the timer used for producing sound beeps? How exactly can a PC produce signals
> of a desired length, as various interrupts and other events can interrupt
> the execution of the 'normal' program?
>
> I thought of two transfer methods:
>
> 1. a 1-bit is coded as a long impulse, a 0-bit is coded as a short impulse.
> but if the program is interrupted during a short impulse, the short impulse
> may become a long impulse!?
>
> 2. a 1-bit is coded as a long low impulse, followed by a short high impulse,
> a 0-bit is coded as a short low impulse, followed by a long high impulse;
> if both impulses are long, the bit is erratic and discarded, and immediately
> sent again. I would consider this as rather reliable!?
>
> Thanks,
> Siggi
>
>
> Siegfried Grob, |
> student of electrical engineering, |
> university of ulm, germany |
> e-mail:
spam_OUTsiegfried.grobTakeThisOuT
student.uni-ulm.de |
> tel&fax: +49 731 25148 |
> --------------------------------------------------'
>