PDA

View Full Version : PIC16F84 lpt dongle



irmus
- 5th May 2004, 08:54
Hello! I want to send data from lpt port and receive other data.How i can this to do?
Thanks

Dwayne
- 5th May 2004, 14:37
Hello Irmus,

You will have to give a little more detail of what you want. To send data Via LPT Port, the Centronics Port is a parallel Port, and you can transmit from most your pic chips to a printer by using one of the 8 bit Busses on the Chips.

BUT!!!! if you have a printer that does NOT have built in fonts, you will not be able to transmit directly to the printer. These Printers are called Window Printers (for ease of defining). And these printers *must* use the windows drivers in order to work.

Some modems are called "WinModems", because they will *only* work in Windows.

Now about your recieve. You must be more explicite. You can use a usart, you can write your own transmit and receive. But either way, you need to explain just a little more on how and what you are trying to accomplish. Recieve could mean something such as receiving a pulse every second, to sending data like a modem.

Dwayne

irmus
- 5th May 2004, 19:20
Thanks for reply!
Sorry,my english is bad i from lithuania.Maybe yuo can give me sample LPT and PIC.Please........!

Dwayne
- 5th May 2004, 19:44
Hello Irmus,

If you use something like a 16f648a chip, using TRISB
in Psuedo Code, it would be simplified as such:


TRISB=%00000000 (assigns all 8 pins to be output)
OutputVariable var byte

Output=(whatever ASCII character you want)
Portb=Output

Toggle Send/Receive line on your Parallel port.

Output=(Carriage return)
Toggle Send/Receive lin on your parallel Port.
End.

Assign Portb.0 to the Centronics Port 0,
and do this with the rest of the 7 pins.

The Send/Receive line can be something like Porta.0 on your 16f648a.


I still do not know what you are trying to accomplish. If you can send some of your Code, some folks can take a look at it.

If you have never programmed with a PIC, the I would first suggest getting your chip to just blink a LED on and off every second. Then get the chip to "count" in binary on 8 LED's. Then try something a little more...Like the above "Psuedo" code. Then you can add a "Receive" to the project, and "Transmit" that receive out to the Printer.


Dwayne

irmus
- 5th May 2004, 19:48
This PIC16F84 is bad for lpt port? Maybe yuo have ICQ.Thanks

Dwayne
- 5th May 2004, 19:59
Hello Irmus,

my ICQ number is on my Membership 31273397

irmus
- 5th May 2004, 20:15
Very thanks