Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Control Lines of the Printer Port

Control Lines of the Printer Port

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sweep123
    wrote on last edited by
    #1

    I can use the 8 data lines of this port OK, but when it comes to using the other 4 output lines on the control section of the port I have no luck. I keep getting 0x0C back when I read these lines (no matter what I set it to):- Note Using PortTalk for Windows 2000: Code: int ReadPortLPT1C(void) { int value = inportb(0x37a); return value; } void WritePortLPT1C(int newData) { outp(0x37a, newData); } As I said it works fine for the data lines (8) at address 0x0378.

    D 1 Reply Last reply
    0
    • S sweep123

      I can use the 8 data lines of this port OK, but when it comes to using the other 4 output lines on the control section of the port I have no luck. I keep getting 0x0C back when I read these lines (no matter what I set it to):- Note Using PortTalk for Windows 2000: Code: int ReadPortLPT1C(void) { int value = inportb(0x37a); return value; } void WritePortLPT1C(int newData) { outp(0x37a, newData); } As I said it works fine for the data lines (8) at address 0x0378.

      D Offline
      D Offline
      douglasjordan
      wrote on last edited by
      #2

      The control port on your PC may be a write only port and reading back the data from it would not be valid. You should check the lines with a scope and verify if they are toggling. If you ultimately require more read lines for your project you can add a latch circuit and use one of the control lines to swap your other signals to read from the 8 data lines.

      B 1 Reply Last reply
      0
      • D douglasjordan

        The control port on your PC may be a write only port and reading back the data from it would not be valid. You should check the lines with a scope and verify if they are toggling. If you ultimately require more read lines for your project you can add a latch circuit and use one of the control lines to swap your other signals to read from the 8 data lines.

        B Offline
        B Offline
        Blake Miller
        wrote on last edited by
        #3

        or.......... purchase a digital IO card and leave the built-in parallel port alone :rolleyes: http://www.accesio.com/go.cgi?p=../digital/digital.html&s=o[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups