Javier, Take a look at www.ustr.net/8051pc/starting.htm Hopefully what you will see is that the TI calculator has been programmed to have a serial interface that behaves like an old serial connected printer, hence why it is connected to the parallel port of the PC. The web page above explains most of it. regards, SW. >>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<< Scott Walsh Plantronics (UK) Ltd. Design Engineer Wootton Bassett Wiltshire SN4 8QQ EMail: scott.walsh@plantronics.com United Kingdom. Tel: +44 1793 84 22 18 (Direct) Tel: +44 1793 84 89 99 (S/Board) Fax: +44 1793 84 23 99 >>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<< ____________________Reply Separator____________________ Subject: Help with C !! Author: pic microcontroller discussion list Date: 27/05/99 01:50 Hi I have a problem, because I don't know C- language !!! I wan't to know how this C code works (it sends byte trough the parallel port to my Ti calculator, the link only has 3 wires and one is GND ). I want to translate it to PIC, so I can interface my Ti with the PIC Anything would help, just a few comnents and I'll try to figure out the rest Thanks for you time Javier /* * Sends a byte to the calculator */ int put92(char data) { int bit; for (bit=0; bit<8; bit++) { if (bit==1) tx(1); if (data&1) { outportb(lpt_out, 2); while (inportb(lpt_in)&0x10); outportb(lpt_out, 3); while ((inportb(lpt_in)&0x10)==0x00); } else { outportb(lpt_out, 1); while (inportb(lpt_in)&0x20); outportb(lpt_out, 3); while ((inportb(lpt_in)&0x20)==0x00); } data>>=1; // may need 10us delay here } } /* * Reads a byte from the calculator */ unsigned char get92(void) { int bit; unsigned char data=0, v; for (bit=0; bit<8; bit++) { while ((v=inportb(lpt_in)&0x30) == 0x30); if (v==0x10) { data=(data>>1)|0x80; outportb(lpt_out, 1); while ((inportb(lpt_in)&0x20)==0x00); outportb(lpt_out, 3); } else { data=data>>1; outportb(lpt_out, 2); while ((inportb(lpt_in)&0x10)==0x00); outportb(lpt_out, 3); } // may need 10us delay here } return data; }