Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Control A Computer printer with a Pic

Status
Not open for further replies.

Rfboy

Member level 1
Joined
Apr 28, 2001
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
232
printer pic

I guys,
I need to connect to a Pic a standard printer like HP or Epson, via RS-232 or parallel port.
Are there a software routine and hardaware interface to do it ???

Help please


Thank you
 

pic of printer

Hi brother, see more information in CCS forum, or try is:

/////////////////////////////////////////////////////////////////////////
//// EX_PSP.C
//// This program demonstrates how the parallel slave port works.
//// This example allows the user to print text from a PC to a PIC.
//// To run this example correctly, an IBM parallel printer cable
//// is needed, with the connections shown below. After installing
//// the generic text printer in Windows, text can be printed to
//// the PIC using a text editor. The text will be displayed via
//// the RS-232
//// This example also shows how to use banks 2 and 3 in 4 bank
//// parts without going to 16 bit pointers (saving ROM).
////
//// Configure the CCS prototype card as follows:
//// Connect pin 23 to 27 and pin 21 to 28.
//// Connect one end of the parrallel printer cable to the PC.
//// Also make the following connections:
//// IBM parallel
//// cable pin Protoboard
//// 1 22 E1
//// 2 32 D0
//// 3 33 D1
//// 4 34 D2
//// 5 35 D3
//// 6 36 D4
//// 7 37 D5
//// 8 38 D6
//// 9 39 D7
//// 11 1 C0
//// 12 27 gnd
//// 13 28 +5V
//// 15 28 +5V
//// 18 27 gnd
//// See additional connections below.
////
//// This example will work with the PCM and PCH compilers. The
//// following conditional compilation lines are used to include a
//// valid device for each compiler. Change the device, clock and
//// RS232 pins for your hardware if needed.
/////////////////////////////////////////////////////////////////////////


#if defined(__PCM__)
#include <16c77.h>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7) // Jumpers: 8 to 11, 7 to 12


#elif defined(__PCH__)
#include <18c452.h>
#fuses HS,NOPROTECT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7) // Jumpers: 8 to 11, 7 to 12
#error For PIC18 change read/write _bank to use a buffer
#endif

#define BUSY_LINE PIN_C0
#define BUFFER_SIZE 96


int next_in = 0;
int next_out = 0;
short data_lost = TRUE;

#int_psp
void psp_isr() {

if(psp_overflow())
data_lost=TRUE;

if(psp_input_full()) {
write_bank(2, next_in++, input_D());
if(next_in == BUFFER_SIZE)
next_in = 0;
if(next_in == next_out)
output_high(BUSY_LINE);
}
}


main() {

setup_adc_ports(NO_ANALOGS);
setup_psp(PSP_ENABLED);
enable_interrupts(GLOBAL);
enable_interrupts(INT_PSP);

output_low(BUSY_LINE);

printf("Waiting for print data... \r\n\n");

while(true)
{
if(next_in!=next_out)
{
putc(read_bank(2,next_out));
if(++next_out==BUFFER_SIZE)
next_out=0;
if(data_lost) {
printf("\r\nData Lost!!!\r\n");
data_lost = FALSE;
}
output_low(BUSY_LINE);
}
}
}
 

printer to pic

I think Rfboy need the other way -> transfer data from the pic to the printer. If it is like that, you can't use the PSP because it's a slave port. You should use the port of the psp with some others signals to simulate a parallel portof a standard pc.
Perhaps it is easier to use RS232.

by,
cube007
 

pic printer

This might help:

SOFTWARE INTERFACE
------------------

To print to a "CENTRONICS" printer, the following handshaking
sequence must be followed, for each character:

The microcontroller must make the !STROBE line to the printer
high. This tells the printer that the microcontroller wants
to modify the DATA on the data bus.

Now the microcontroller must wait for the BUSY line from the
printer to go low. If the printer is still busy processing
the DATA on the data bus, it will keep the BUSY line high to
tell the microcontroller that it must keep the DATA on the
data bus stable and that it may not send new DATA yet. When
the printer has finished processing the DATA on the data
bus, it will make the BUSY line low, indicating to the
microcontroller that it is now ready to accept new DATA.



Now the microcontroller may place the ASCII code of the next
character to be printed on to the data bus.

Now the microcontroller must make the !STROBE line to the
printer low. This tells the printer that there is valid DATA
on the data bus, for it to process.

Now the microcontroller must wait for the BUSY line from the
printer to go high. When the microcontroller sees the BUSY
line from the printer go high, it knows that the printer has
seen the new DATA and that it is busy processing it.

It is a good idea to isolate the output from the PIC to the printer
with suitable buffers, to prevent the printer from feeding power
back to the PIC if the power to this is disconnected.
 
printer+pic

There is a company called E-Lab Inc. They produce very nice ICs, for example, you can connect LCD to MCU using only one pin on MCU. Same thing is for keyboard or printer.

EDE300 Serial/ Parallel Data Transceiver (PC Interface IC!)
EDE700 Serial Text LCD Controller IC
EDE702 Low Cost Serial Text LCD Controller IC
EDE707 Octal Seven-Segment LED Decoder
EDE1144 4x4 Keypad Encoder IC
EDE1188 8x8 Keypad Encoder IC
EDE1200 Unipolar Stepper Motor Controller IC
EDE1204 Bi-Polar Stepper Motor Controller IC
EDE1400 Serial to Parallel-Printer IC

The last one is what you need.

**broken link removed**

meax98
 

ede1400

Thank you guys,

I have another qustion about printer and Pic, it is possible to connect togheter via USB interface ??????

Guys you are the best !!!!!!!

Thank you again !!!!!!!!!
 

pic mcu conect printer

Another nice company called Future Technology Devices Intl Ltd **broken link removed**

produce nice IC:

FT232BM - USB UART device - **broken link removed**

FT245BM - USB FIFO device - **broken link removed**

Take look at FT245BM and this is a answer to your question. This IC is very easy to use (only few external components).

regards
meax98
 

pic serial printer

HI RFBOY
IF CAN GET "EVERYDAY PRACTICAL ELECTREONICS" ,JULY 2001
U WILL FIND AN ARTICLE ABOUT PIC TO PRINTER INTERFACE
SORRY MY SCANNER IS NOT WORKING RIGHT NOW "SO THAT I SEND U A COPY OF THE ARTICLE :(
BUT TRY TO C
**broken link removed**
U WILL FIND THE SOFTWARE THERE ,IN ASSEMBLY 'I THINK'
 

pic16 printer code

After I have the interface, I wnat to print a picture. Anyone know how to write the driver.
 

laser printer microcontroller pcl

Hi there,

I would like to control a computer printer with a Pic 16F877 if possible.Is there any sample source code around in c please? Thnx.

Analyzer. :?
 

laser printer controler using pic

It's not a whole lot more than setting 8 databits and pulsing the strobe line on the parallel port, when using the 'classic' IEEE 1248 port.

See
https://www.fapo.com/cenmode.htm
https://www.fapo.com/1284int.htm
for a bit more info.

This is enough to print plain text characters. If you need formatting and/or graphics, you'll need to get the command-set of your printer. For example PCL for most HP printers, or Postscript for some laser printers.

Hope this gets you starting.
 

ede707 pic example

HI ANALYZER


This was can be found at epe web site published in 2001-07 epe and based on pic 16f877 source code for the pic is free at there fttp site
have look

regards
Fragrance
 

keypad encoder ic availability in india

Hi,

Thanks fragrance i think you pointed this link : **broken link removed**

I found sample code but there is no schematic in zip file? Or did i miss it?

Analyzer.
 

pic printer

Hi Analyzer!

This might be the file you're looking for!!!

Bye
 

pic serial to parallel printer

hugo said:
Hi Analyzer!

This might be the file you're looking for!!!

Bye

This file is very useful to me.

Thank you.
 

pic controller with dot printer

@Hugo:

That's what i am looking for buddy! 10x
88

Analyzer
 

centronic printer output for pic microcontroller

u can download epe july 2001
**broken link removed**
 

pic to printer

i seems like having trouble on downloading anything in this forum, may i know y?? anyone experiecnce this???plz help........
 

Re: laser printer controler using pic

It's not a whole lot more than setting 8 databits and pulsing the strobe line on the parallel port, when using the 'classic' IEEE 1248 port.

See
https://www.fapo.com/cenmode.htm
https://www.fapo.com/1284int.htm
for a bit more info.

This is enough to print plain text characters. If you need formatting and/or graphics, you'll need to get the command-set of your printer. For example PCL for most HP printers, or Postscript for some laser printers.

Hope this gets you starting.

Hi,
I have to emulate the serial printer on PC so that any data send to serial printer will be receive on pc. my concern in only plain text for now if u have any info please provide
 

hello,

this is a portion of code TurboC2.00
as an example to drive an EPSON FX800 printer to do a hardcopy of an area of screen.
This code drive directly the LPT port .. with ESC P sequences.
If your printer is an EPSON With ESC P command,it's quiete easy to drive it by a PIC..
 

Attachments

  • HARDCOP.C.txt
    2.2 KB · Views: 77

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top