th3gr8
Member level 4
- Joined
- Aug 27, 2013
- Messages
- 68
- Helped
- 6
- Reputation
- 12
- Reaction score
- 6
- Trophy points
- 8
- Activity points
- 398
hi,
I don't use C programming, but PORTD and E2,1,0 of the 16F877A are designed to operate with external peripherals , ie: printer etc.
Look up your printer Character and Control codes.
E
Also, can i use usb-to-serial converter for a printer with USB port??
No.Also, can i use usb-to-serial converter for a printer with USB port??
I want to know that by directly connecting these pins with my printer, will i be able to print something
hello,
Yes, if your PIC is powered with 5V DC, you have TTL level compatible signals to directly drive a parallele printer.
Maybe just to add pull up resistor 4,7K on output because internal pull up to high value.
What kind of printer ..?
What kind of protocole ?
example: for EPSON printer ESC protocole
or CITIZEN 24
or ...
this one is easy to interface..
HP printer is a bit more complicated..
I don't see a need for pull-up resistors if the outputs are configured push-pull as usual for parallel printer interface.
You don't need a specfic protocol to print simple text. Epson ESC C or HP PCL protocols are used to change fonts or print graphics. You should refer to the manual of your printer which extended functions are available beyond generic text printing.
Yes, just connecting data lines, /STB, BUSY.Will simple and uni-directional parallel protocol be efficient enough??
Yes, just connecting data lines, /STB, BUSY.
Crystal frequencies and baudrate dividers, see PIC datasheet.
You minimally nead a handshake means for the printer to pause output from µC. This can be either RTS pin or XON/XOFF software handshake, if supported by your printer. RTS is probably the simplest way.
while (CTS==1) send_data();
9600 baud sounds good. The sequence can be simplified to
Code:while (CTS==1) send_data();
You didn't tell if the printer has TTL or RS232 level interface. In the latter case level converters would be needed.
Actually RxD won't be needed for generic text printing with CTS control, only two lines.
There are different flavours of serial interface, logic level(TTL) and high level(RS232). RS232 is inverted compared to TTL.
Check the documentation.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?