587,777 active members*
2,603 visitors online*
Register for free
Login
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Posts
    62

    rs232\serial port (Voltage)

    I am having trouble using a pic programmer. post

    And want to rule out the serial port. From what I understand there are different types that use different voltages 5volts ~ 12volts and what to know how to tell the difference.

    I have bean searching and searching for info for the command for the serial port in QBasic. Similar to the parallel portOUT,888 1 will give you the high voltage over pins 2, 25.

    I thought this would be an easy thing to find. I was wrong!! I’ve found loads of beginners guides, and lots of people getting LEDs to flash with the parallel port but absolutely nothing on the serial port.
    I did find some commands for it in a Linux, but my only experience of using Linux is knoppix which is a bootable Live system on CD so had some trouble understanding it.
    I also found some info for c but as i have never used it before, Perhaps I should start as it’s a proper programming langue, but I like my basic as that was my first contact I ever had with a computer which was a bbc .



    Just a trip down memory lane.

    If you can help please do
    Thank you jm

  2. #2
    Join Date
    Mar 2003
    Posts
    45
    jm,

    Well I can tell you what to look for on the serial port (DP-9) connector on the back of your computer if it is a fairly recent PC.

    If it uses true RS-232 levels you should see somewhere between -8 to -12 VDC between Pin 3 (TX) and Pin 5 (GND) while not transmitting. While transmitting, the TX pin will swing between a negative voltage (-8 to -12 VDC) and a positive voltage (8 to 12 VDC) depending on if the bit it is sending is a “mark” or a “space” (1’s & 0’s talk for the asynchronous type protocol used with RS-232). If using a volt meter to read while transmitting, the display will stutter, probably around 0 VDC.

    A quick test to see if the port is working is to start a terminal program (if you have a PC running a Windows OS, you can use Hyper Terminal – it comes with the OS). Set the terminal program to use the serial port in question (baud rate, parity, stop bit, etc. are not important for this test). Short pins 2 and 3 together on the DB-9 connector (same pins if it is a DB-25 connector). Hit some character keys on the keyboard and see if they are echoed (displayed) back to the screen.

    Hope this helps. . .

    plm

  3. #3
    Join Date
    Jun 2005
    Posts
    62
    hi pmurray
    thanks for the info I think I’ve found my problem.
    abasir and smarbaga told me similar but I wanted to make shore
    I am using my old laptop running win95
    somewhere between -8 to -12 VDC between Pin 3 (TX) and Pin 5 (GND)
    I am only getting 0.65volts. I tried restarting in dos but it was still just 0.65volts and I also tried resetting the bios setting but this also made no difference. So I think its blown.
    I wanted to get a desktop eventually to use for cnc anyway, so this has made it a bit more of a priority, and a PCI I/O Expansion card so I don’t have to use the ports on the mother board.

    Thanks jm

    Just out of interest if any one does know the serial port address in basic, or if you cant use it. please let me know as It has started to bug me that I couldn’t find out. I had a idea that it could be (out,232) as in rs232, but as my serial port doesn’t seam to be working so I don’t know.

  4. #4
    Join Date
    Mar 2005
    Posts
    1498
    050717-0730 EST USA

    jm:

    Use "The Programmers PC Sourcebook" by Thom Hogan as a source of addresses. Or go to the original IBM Technical Reference manuals.

    Use the reference book "Microsoft QuickBasic" for DOS 4.5, the File and Device I/O chapter, p120-121, for some of your information.

    Use DEBUG and write some simple 8086 instructions to probe the serial port.

    My Sony laptop disables all RS232 lines when inactive. My old Toshiba laptop has relative to pin 5 (logic common) -9.2 on pins 3, 4, and 7 at rest. The inputs are 0 v.

    Note: the UART does not directly connect to the RS232 connector, but drives one or more interface chips, such as 1488, that do level conversion from/to TTL and RS232.

    .

  5. #5
    Join Date
    Aug 2005
    Posts
    52
    On most computer, the address for the COMM1 serial port is 3F8 hex or 1016 decimal. I believe the syntax to use the OUT command in QBasic is OUT (Address), (1 Byte Data) Try using...

    OUT 3F8h, 85 should send a 01010101 (toggle bit) out your RS232 port.

    ~~~~~~~~~~~~~~~~~~~~~
    Connect pin 2 and 3 on your COMM port (your making a loop-back plug) to verify to comm port is working. You cannot accuratly measure the voltage levels of you comm port with a digital multimeter.

  6. #6
    Join Date
    Jun 2005
    Posts
    62
    Thanks for the replies I spent a bit of time rummaging in the garage looking for my old computer books a after a couple of hours I found them, and it’s just a single garage so you get an idea of how much stuff is in it. Well I found [how to interface Pc’s] and If any body else wants to know it gives the four serial port base addresses as
    1. PORT BASE ADDRESS IRQ
      ONE 3F8 4
      TWO 2F8 3
      THREE 3E8 4
      FOUR 2E8 3

    Quote Originally Posted by Megahertz
    OUT 3F8h, 85 should send a 01010101
    that look right to me, going on what’s in the book. I’ll have to try and give it a go some time when I get around to getting a old (new to me) computer.
    jm

Posting Permissions

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