| Details |
Message |
|
Read-Only
Author kppp kpp
Posted 7-Sep-2007 05:35 GMT
Toolset C51
|
 printer interfacing
kppp kpp
hello there,
i want to know the printer interfacing with 8051
i have interfaced it and it is working fine
-but when paper is not put properly that time my machine hangs can u
guide me what to do in such case
is it related to BUSY signal?????
pls reply
|
|
|
Read-Only
Author tw fabio
Posted 7-Sep-2007 06:42 GMT
Toolset C51
|
 How Can I Use P6.6 And P6.7 As General I/o
tw fabio
p6.6,50,*RXD2,"Debug, SerialPort, DSPortAdapter",Can configure as
native I/O
p6.7,49,*TXD2,"Debug, SerialPort, DSPortAdapter",Can configure as
native I/O
How can I change them to general I/O
Which register control them?
Anyone know the answer?
Thank you.
|
|
|
Read-Only
Author Andy Neil
Posted 7-Sep-2007 09:47 GMT
Toolset None
|
 RE: How Can I Use P6.6 And P6.7 As General I/o
Andy Neil
See: http://www.keil.com/forum/docs/thread10609.asp
|
|
|
Read-Only
Author Andy Neil
Posted 7-Sep-2007 07:05 GMT
Toolset C51
|
 Insufficient Information!!
Andy Neil
"i want to know the printer interfacing with 8051"
What printer?
What 8051?
What type of interface does the printer have - USB? Centronics?
Serial? Or what?
"i have interfaced it and it is working fine"
Is it?
"but when paper is not put properly that time my machine
hangs"
So it is not fine - it has a bug!
"can u guide me what to do in such case"
You need to debug it!
For a strart, you need to determine exactly what is happening when
it "hangs"
"is it related to BUSY signal?"
Who knows?!
You've given absolutely no details whatsoever of the printer, its
interface, your circuit, or your software - so how can anyone
possibly make any informed suggestions?!
Your question really is just like, "my car won't work - what is
wrong with it?" !
For a start, you need to read the printer Manual to
determine how (or whether) it uses the BUSY signal.
Then check that your hardware & software correctly handles
this.
Also, check what actually happens on the printer in this situation
- preferably with an oscilloscope.
Again, check that your hardware & software correctly handles
this.
If you can connect the printer to a PC, you could also try seeing
what happens in that case...
|
|
|
Read-Only
Author Andy Neil
Posted 7-Sep-2007 09:52 GMT
Toolset C51
|
 Hanging software
Andy Neil
One common reason for software hanging is infinite loops!
eg, if you have a loop that waits for an event, but that event
never happens, or you miss it, your software will hang:
while( event_not_happened_yet )
{
// do nothing - wait
}
You need to provide a timeout or some other means to exit the loop
in case of an excessive delay...
|
|
|
Read-Only
Author Per Westermark
Posted 7-Sep-2007 11:28 GMT
Toolset C51
|
 RE: Hanging software
Per Westermark
Yes, more than one interface has busy signals to inform the PC
that no more data may be sent until the printer is ready.
From the signal name, I assume that you are talking about the
centronics interface. When the printer runs out of paper (or
sometimes if you set it off-line), the printer interface in your PC
will stop sending characters until you add paper.
|
|
|
Read-Only
Author Andy Neil
Posted 7-Sep-2007 11:50 GMT
Toolset C51
|
 RE: Un-Hanging software
Andy Neil
"When the printer runs out of paper (or sometimes if you set it
off-line), the printer interface in your PC will stop sending
characters until you add paper."
So the question to the OP is: does your software recover when you
correct the "paper is not put properly" situation?
|
|
|
Read-Only
Author kppp kpp
Posted 10-Sep-2007 07:13 GMT
Toolset C51
|
 RE: printer interfacing
kppp kpp
80451 is the microcontroller and printer interfacing is
centronics
i have resolved the problem as it was stuck in the while loop which i
was using for 'print complete' screen now i have removed the screen
and while statement and now it is fine. i hav just added 'sent to
print' screen. it is related to paper out signal but we are not using
this signal now.
|
|
|
Read-Only
Author kppp kpp
Posted 10-Sep-2007 07:18 GMT
Toolset C51
|
 RE: printer interfacing
kppp kpp
thanx for ur help and suggetion and next time i will give details
because i was accessing this site for first time
thanx
|
|
|
Read-Only
Author Per Westermark
Posted 10-Sep-2007 07:21 GMT
Toolset C51
|
 RE: printer interfacing
Per Westermark
If you are going to send text to a Centroncs-connected printer,
you really have to care about this signal. You may loose your
printout if the printer is off-line. Also laser printers or ink-jet
printers may run out of paper, or the user may manually have set the
printer off-line and forgotten about it.
|
|