Shop OBEX P1 Docs P2 Docs Learn Events
TTL and Parallel Port — Parallax Forums

TTL and Parallel Port

firestorm.v1firestorm.v1 Posts: 94
edited 2006-04-24 17:24 in BASIC Stamp
I have another project in the works and I need to find out some information pertaining to the Basic Stamp.

My idea is a parallel port driven BS2 that can intercept and decode the pin states received from the parallel port connection on a PC. I know that the "E" pin (or STROBE on the parallel port) causes the LCD to read the pin states and print relevant information out on the serial port (Pin 16) such as line states and data, what the pin states do, etc. I can get the BS2 to do the same by using the following code, correct?

if (pin0='1') THEN
Read other pins here.
ENDIF


The serial output will be something like:
DDDDDDRR
01234567SW
1000000000 - Clear Screen
1111000000 - Enable Display, Turn Cursor On, Set cursor to blink.
...
...
etc.

My questions:
1: Is the code above a valid way of detecting the strobe pin state? Does anyone see any issue with this as far as speed is concerned? (this is going to be used to debug a LCD controller application on the PC.)

2: The voltages coming out of the parallel port are TTL, correct? Are there any safeguards I should be aware of before I attempt to interface to it? (aside from a common ground is required... (already been bit by that one.)

3: Anyone have any ideas or suggestions?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-24 17:12
    The LPT Port pins are TTL, you need a common ground though.· You may be able to read the Parallel data using that IF...THEN routine if you have an INL or INH in there reading the states of the 8 data lines, however that is not going to force the data to serially output anywhere.· It will simply be in whatever variable you put it in.· You will have to act on it from there.· The rate at which the data is written to the LPT Port will determine whether or not the BASIC Stamp can read, act upon, and have time enough to get the next data.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • firestorm.v1firestorm.v1 Posts: 94
    edited 2006-04-24 17:24
    I figured that I would need to write the supporting code to read, translate and resend the code but I wasn't sure if the Bs2 could receive that info. Thanks for the tip, I'll see what happens in the next couple of weeks. [noparse]:)[/noparse]
Sign In or Register to comment.