Port Power (almost finished now)

This is a discussion on Port Power (almost finished now) within the C Programming forums, part of the General Programming Boards category; mmm....well my circuit finally completely works...ive got the 8 data pins on the 25-pin connector wired up to the 8 ...

  1. #1
    Registered User SavesTheDay's Avatar
    Join Date
    Jan 2002
    Posts
    77

    Port Power (almost finished now)

    mmm....well my circuit finally completely works...ive got the 8 data pins on the 25-pin connector wired up to the 8 pins of the LCD im using....ive got the 25th pin (which is grounde) wired up to the cathode pin on the LCD....now when I plug it in to the parallel port, they all immediately light up....

    Code:
    outportb(0x378,0x28);
    I thought by using this code, I'd be sending the hex value of 28 to the LCD...the hex value of 28 in binary is of course: 00101000. I figure this would go like this

    Code:
    2^0 - 1st Data Pin -       0
    2^1 - 2nd Data Pin -      0
    2^2 - 3rd Data Pin -       0
    2^3 - 4th Data Pin -       1
    2^4 - 5th Data Pin -       0
    2^6 - 6th Data Pin -       1
    2^7 - 7th Data Pin -       0
    2^8 - 8th Data Pin -       0
    (that's not really code, just what would get sent to each pin I think). A 1 would supply the current to light up that part of the LCD, and the 0's would do nothing.


    Anyone know why it's already lighting up? Am I using the outportb(0x378,0x28) command right....will that do what I think it is?

    Also could the problem be the cable I'm using? I think it's an odd one....it's a 25 pin Male/Male but it says Direct Cable Connection (PC-to-PC File Transfer) ....on the back it says it CAN'T be used with switchboxes...it's only made for PC-PC file transfer..should this cable work, or is this the possible cause of my problem? Thanks.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,541
    > Also could the problem be the cable I'm using?
    Yes - those kinds of pc-to-pc cables look like this

    Code:
    Tx----   ------Tx
          \ /
           X
          / \
    Rx----   ------Rx
    The bits which you think are being sent out are being mixed by the cross-over (and some of them won't even make it)

    You need a simple cable which just joins pin1 to pin1, pin2 to pin2 etc.

    Mmm, maybe this will help
    http://vv.carleton.ca/~neil/lpt/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 01:58 PM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 03:28 AM
  4. Port power
    By frenchfry164 in forum Networking/Device Communication
    Replies: 7
    Last Post: 07-08-2003, 11:05 PM
  5. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 03:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21