need help with code
Archiver
Posts: 46,084
Hello
I can use some suggestions regarding BS2 code for the following app:
I have a device that outputs to a printer via a centronics parallel
port. I would like to use the BS2 with LCD to capture output from the
devices' printer port.
I am comfortable interfacing the LCD to the stamp, but am stuck with
the rest of it. I would appreciate any suggestions or tips anyone may
have.
Thanks in advance. Regards, Richard Cochran
I can use some suggestions regarding BS2 code for the following app:
I have a device that outputs to a printer via a centronics parallel
port. I would like to use the BS2 with LCD to capture output from the
devices' printer port.
I am comfortable interfacing the LCD to the stamp, but am stuck with
the rest of it. I would appreciate any suggestions or tips anyone may
have.
Thanks in advance. Regards, Richard Cochran
Comments
All pins are Centronics 36-pin type.
(I don't have the PC DB-25 mapping
with me right now)
All signals are TTL 0..5V.
1. The 8 data pins (2..9) -- From PC
2. /Strobe (1) -- From PC
3. Busy (11) -- From Printer
( High when: Printing Char, Off-Line, other err)
4. /Ack (10) -- From Printer
5. GND (Pin 19..30, 33) -- (Pick one)
-- Optional --
6. /Error (Pin 32) -- From Printer
(Low when: Paper out, Off-line, other err)
7. PaperOut (Pin 12) -- From Printer, High=Err
The protocol is (from POV of sending device to printer):
Initial settings: All Data 0, /Strobe High.
1. Put the 8 data signals on the data lines.
2. Wait .5 uS minimum
3. Put /Strobe low.
4. Wait .5 us minimum
5. Raise /Strobe high.
6. Wait .5 uS minimum
7. At this point, may release data lines,
drive them to 0, or leave them alone.
8. After step 3, 'BUSY' from the printer should have
gone high.
9. Once the printer has dealt with the character, it
will put /ACK Low, wait approx 7 uS, put BUSY Low,
wait approx 5 uS, then put /ACK High.
"Data transfer can be carried out only after
receipt of the /ACK signal, or when the level
of the BUSY signal is LOW."
(Epson FX85 Docs, Pg J-3, Copyright 1985)
If your goal is to REPLACE the printer, then the
BS2 must act like the printer.
To begin, it should hold BUSY Low, /ACK High.
The BS2 should then monitor the /Strobe signal. When
/Strobe goes low, the BS2 should read the data lines,
then raise BUSY.
The BS2 should then wait 1 mSec, Lower /ACK, Lower Busy,
raise /ACK, and monitor /STROBE some more.
If your goal is to MONITOR the printer (ie there
is still a printer in the line) then you should
let the PRINTER do the handshake, and only use
the BS2 to monitor the /STROBE line, and read
the DATA pins when it goes low.
Good luck. Tell us how it turns out.
--- In basicstamps@yahoogroups.com, "iceninevt" <iceninevt@y...>
wrote:
> Hello
>
> I can use some suggestions regarding BS2 code for the following app:
>
> I have a device that outputs to a printer via a centronics parallel
> port. I would like to use the BS2 with LCD to capture output from
the
> devices' printer port.
>
> I am comfortable interfacing the LCD to the stamp, but am stuck
with
> the rest of it. I would appreciate any suggestions or tips anyone
may
> have.
>
> Thanks in advance. Regards, Richard Cochran
Thanks for the information, that's exactly what I needed. I did get
the code to run. One small problem I encountered - The STROBE pulse
is very fast. The stamp had to spend all it's time looking for the
strobe pulse, if the stamp was doing something else, even briefly,
the strobe pulse was sometimes missed. I really wanded to do this
with just the stamp, but I ended up using the centronics strobe pulse
to clock data into a 74HCT574 octal D flip-flop, once that happened
the stamp sent BSY back to the device. Data was latched on the flip-
flop outputs, the stamp could process this data at it's leisure. I am
still working on this and I am having a few problems, but the circuit
and code does run (somewhat)..
Thanks for your help. Regards, Rich Cochran
--- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
wrote:
> There are several signals you'll need to monitor.
> All pins are Centronics 36-pin type.
> (I don't have the PC DB-25 mapping
> with me right now)
>
> All signals are TTL 0..5V.
>
> 1. The 8 data pins (2..9) -- From PC
> 2. /Strobe (1) -- From PC
> 3. Busy (11) -- From Printer
> ( High when: Printing Char, Off-Line, other err)
> 4. /Ack (10) -- From Printer
> 5. GND (Pin 19..30, 33) -- (Pick one)
>
> -- Optional --
> 6. /Error (Pin 32) -- From Printer
> (Low when: Paper out, Off-line, other err)
> 7. PaperOut (Pin 12) -- From Printer, High=Err
>
>
> The protocol is (from POV of sending device to printer):
> Initial settings: All Data 0, /Strobe High.
>
> 1. Put the 8 data signals on the data lines.
> 2. Wait .5 uS minimum
> 3. Put /Strobe low.
> 4. Wait .5 us minimum
> 5. Raise /Strobe high.
> 6. Wait .5 uS minimum
> 7. At this point, may release data lines,
> drive them to 0, or leave them alone.
>
> 8. After step 3, 'BUSY' from the printer should have
> gone high.
> 9. Once the printer has dealt with the character, it
> will put /ACK Low, wait approx 7 uS, put BUSY Low,
> wait approx 5 uS, then put /ACK High.
>
> "Data transfer can be carried out only after
> receipt of the /ACK signal, or when the level
> of the BUSY signal is LOW."
> (Epson FX85 Docs, Pg J-3, Copyright 1985)
>
> If your goal is to REPLACE the printer, then the
> BS2 must act like the printer.
>
> To begin, it should hold BUSY Low, /ACK High.
> The BS2 should then monitor the /Strobe signal. When
> /Strobe goes low, the BS2 should read the data lines,
> then raise BUSY.
> The BS2 should then wait 1 mSec, Lower /ACK, Lower Busy,
> raise /ACK, and monitor /STROBE some more.
>
> If your goal is to MONITOR the printer (ie there
> is still a printer in the line) then you should
> let the PRINTER do the handshake, and only use
> the BS2 to monitor the /STROBE line, and read
> the DATA pins when it goes low.
>
> Good luck. Tell us how it turns out.
>
> --- In basicstamps@yahoogroups.com, "iceninevt" <iceninevt@y...>
> wrote:
> > Hello
> >
> > I can use some suggestions regarding BS2 code for the following
app:
> >
> > I have a device that outputs to a printer via a centronics
parallel
> > port. I would like to use the BS2 with LCD to capture output from
> the
> > devices' printer port.
> >
> > I am comfortable interfacing the LCD to the stamp, but am stuck
> with
> > the rest of it. I would appreciate any suggestions or tips anyone
> may
> > have.
> >
> > Thanks in advance. Regards, Richard Cochran
Thanks for the feedback, glad I could help.
--- In basicstamps@yahoogroups.com, "iceninevt" <iceninevt@y...>
wrote:
> Allen
>
> Thanks for the information, that's exactly what I needed. I did get
> the code to run. One small problem I encountered - The STROBE pulse
> is very fast. The stamp had to spend all it's time looking for the
> strobe pulse, if the stamp was doing something else, even briefly,
> the strobe pulse was sometimes missed. I really wanded to do this
> with just the stamp, but I ended up using the centronics strobe
pulse
> to clock data into a 74HCT574 octal D flip-flop, once that happened
> the stamp sent BSY back to the device. Data was latched on the flip-
> flop outputs, the stamp could process this data at it's leisure. I
am
> still working on this and I am having a few problems, but the
circuit
> and code does run (somewhat)..
>
> Thanks for your help. Regards, Rich Cochran
>
> --- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
> wrote:
> > There are several signals you'll need to monitor.
> > All pins are Centronics 36-pin type.
> > (I don't have the PC DB-25 mapping
> > with me right now)
> >
> > All signals are TTL 0..5V.
> >
> > 1. The 8 data pins (2..9) -- From PC
> > 2. /Strobe (1) -- From PC
> > 3. Busy (11) -- From Printer
> > ( High when: Printing Char, Off-Line, other err)
> > 4. /Ack (10) -- From Printer
> > 5. GND (Pin 19..30, 33) -- (Pick one)
> >
> > -- Optional --
> > 6. /Error (Pin 32) -- From Printer
> > (Low when: Paper out, Off-line, other err)
> > 7. PaperOut (Pin 12) -- From Printer, High=Err
> >
> >
> > The protocol is (from POV of sending device to printer):
> > Initial settings: All Data 0, /Strobe High.
> >
> > 1. Put the 8 data signals on the data lines.
> > 2. Wait .5 uS minimum
> > 3. Put /Strobe low.
> > 4. Wait .5 us minimum
> > 5. Raise /Strobe high.
> > 6. Wait .5 uS minimum
> > 7. At this point, may release data lines,
> > drive them to 0, or leave them alone.
> >
> > 8. After step 3, 'BUSY' from the printer should have
> > gone high.
> > 9. Once the printer has dealt with the character, it
> > will put /ACK Low, wait approx 7 uS, put BUSY Low,
> > wait approx 5 uS, then put /ACK High.
> >
> > "Data transfer can be carried out only after
> > receipt of the /ACK signal, or when the level
> > of the BUSY signal is LOW."
> > (Epson FX85 Docs, Pg J-3, Copyright 1985)
> >
> > If your goal is to REPLACE the printer, then the
> > BS2 must act like the printer.
> >
> > To begin, it should hold BUSY Low, /ACK High.
> > The BS2 should then monitor the /Strobe signal. When
> > /Strobe goes low, the BS2 should read the data lines,
> > then raise BUSY.
> > The BS2 should then wait 1 mSec, Lower /ACK, Lower Busy,
> > raise /ACK, and monitor /STROBE some more.
> >
> > If your goal is to MONITOR the printer (ie there
> > is still a printer in the line) then you should
> > let the PRINTER do the handshake, and only use
> > the BS2 to monitor the /STROBE line, and read
> > the DATA pins when it goes low.
> >
> > Good luck. Tell us how it turns out.
> >
> > --- In basicstamps@yahoogroups.com, "iceninevt" <iceninevt@y...>
> > wrote:
> > > Hello
> > >
> > > I can use some suggestions regarding BS2 code for the following
> app:
> > >
> > > I have a device that outputs to a printer via a centronics
> parallel
> > > port. I would like to use the BS2 with LCD to capture output
from
> > the
> > > devices' printer port.
> > >
> > > I am comfortable interfacing the LCD to the stamp, but am stuck
> > with
> > > the rest of it. I would appreciate any suggestions or tips
anyone
> > may
> > > have.
> > >
> > > Thanks in advance. Regards, Richard Cochran