Find the answer to your Linux question:
Results 1 to 7 of 7
I built a good little program to access data from an A/D via the printer port but would like to move this to the com port. Can someone direct me ...
  1. #1
    Linux User
    Join Date
    Mar 2008
    Posts
    287

    Access Com Port

    I built a good little program to access data from an A/D via the printer port but would like to move this to the com port.
    Can someone direct me to source C (not ++), shell, or Basic program or good instructional site which uses or describes the sequential operations needed to capture data from an A/D (ad0831 would be great)?
    I am apparently not using the correct terms in my google search.
    Thanks in advance.

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    You may be able to make minimal changes to your "good little program" and make it work.

    Would you please post that program in its entirety, so we can see what's going on?

    (I'm sure that you're not wanting people to post code to do a homework assignment for you, but posting your code will also give us comforting assurance of that.)
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Linux User
    Join Date
    Mar 2008
    Posts
    287

    Access Com Port

    After completing 2 Master's degrees and course work for my doctorate I doubt I would be needing help for classwork.
    I shudder to post the document as it is too long and loaded with comments.
    It is an expansion of Patrick Bowman's code included in his "Interfacing with Serial Printer Port" 22 Dec 2000 out of Vanier College which with the foregoing you can see pretty much what is in the code I use relative to the port. From that you will see that he ran:
    pin1 of the AD0831 to pin 16 of the DB25 male
    pin4 " " " " " 25
    pin6 " " " " " 12
    pin7 " " " " " 01
    His code explains this. I have tried understanding the differences between the 9 and 25 pins ports and what appears to be differences in logic between the pinning especially for 16 and 12. I think it is here where I have my problem.
    Thanks for the help.

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    I'm not familiar at all with the AD0831, but the following googled search terms seem to be helpful:
    Code:
    adc 8031
    adc8031
    serial pin
    It's been a while since I've done serial I/O in C, and I've never wired a serial cable, but it seems that normally pins 12 and 25 are not used. I'm not sure how you're going to address that situation. Googling the first two lines of terms above will help, I hope.

    There is, however, something I can offer.

    If you're going to do serial port programming in C, two things help.

    First, you need to know the baud rate, number of stop bits (usually one), bits per data byte (usually eight), and parity (usually none) for the device.

    Second, it's useful to have as an example a simple running program which actually uses a serial port. I have such a program. The drawback to this program is that it contains more information than you need, because it uses the modem. There's modem stuff in the program that you'll have to ignore. The program is extensively commented, perhaps pathologically so. It's here, and will remain for at least two weeks.

    Hope this helps a little.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  5. #5
    Linux User
    Join Date
    Mar 2008
    Posts
    287
    Thanks 4 ur code will look at it tomorrow. BTW It uses pin 16 to select the AD then read on pin 12 and uses pin 1 as pseudo CLK. Oh, 25 is ground.
    My problem has been trying to go from what this person did with the pins on DB25 to a DB9.
    In the modem world pin 1 is frame ground and 25 is busy which does not match (i think?) to the above. 16 and 12 are "secondary" receive data and carrier detect, respectively. At this point I get hung.
    I figure that pin 1 on serial is same as 12 on printer port and 2 is same as 16 and 5 is same as 25 (maybe) and where I'd put pin 1 is not known. Thanks very much for the help and I'll look at it tomorrow.

  6. #6
    Linux User
    Join Date
    Mar 2008
    Posts
    287

    Access Com Port

    Bill,
    Better late than never! Found that example program by Tomi Engdahl where he uses a TLC548. Those terms dredge it up from the WEB.

  7. #7
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Glad it worked out for you. Good luck!
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...