PC104 Serial Port Programming Problem

This is a discussion on PC104 Serial Port Programming Problem within the C Programming forums, part of the General Programming Boards category; Let me first give you some background information on what I am attempting to do. I am using the PC104 ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    9

    PC104 Serial Port Programming Problem

    Let me first give you some background information on what I am
    attempting to do. I am using the PC104 board serial ports to... read in GPS position coordinates from a GPS on one serial port, read in measurements from a temperature sensor on another serial port, take these two data strings and combine them, and then via another serial send them to an amateur radio modem for transmission. I am using C for the coding. Now as I said before I can get COM3 (temp sensor) and COM4 (GPS) to read in correctly however when I attempt to use COM1 or COM2 nothing happens. I would also like to add that my temp sensor is powered by the serial port and when it is connected to COM3 or COM4 the power LED illuminates (thus showing that at least something is happening). I have noticed that the difference between the serial ports on my PC and on the PC104 is that on the PC104 when I connect my temp sensor the led light automatically comes on without running my code. However, on my PC, the power light is off until my code is executed. When my code finishes the light goes back off. This ofcourse is not the case with the PC104 board. The power LED is ON constantly when the temp sensor is pluged into COM3 and COM4 and always off when I connect it to COM1 and COM2 (thus showing it is receiving no power. I have tried to connect COM2 to my PC and transmit some characters however this does not work, nor does the receive. If some could lend me some aid it would be most helpful. Thanks

  2. #2
    Sr. Software Engineer filker0's Avatar
    Join Date
    Sep 2005
    Location
    West Virginia
    Posts
    235
    Could you give us a pointer to PC104 board documentation? What OS are you using, if any? How are you accessing the ports? Directly via the device registers or through the OS? Are the ports all enabled? Which signal line does the power come from? Without that information, it is less likely that we will be able to help much.
    Insert obnoxious but pithy remark here

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    9

    PC104 Answers to your question

    As for your first question I have attached a SBC1390 Manual Excerpt which may help you. Section 4.6 details the serial ports as does Section 7.3. I am using GS-DOS, this came preinstalled on the board. To access the serial ports I am using inport()/outport() functions. To the best of my knowledge all of the ports are enabled however I am not exactly sure how to check this. (could you tell me how to check this) If you can't tell I don't have much CS experience and I am learning all of this as I go. All I can tell you is that COM3 and COM4 work with my code, and COM1 is connected to my terminal screen on my PC. Also when I attach the load cable to COM2 the boot block comes up as it should. The power comes from the DTR and RTS lines. If any information I have provided is still too vague please let me know. I will gladly continue to answer any of your questions.
    Attached Files Attached Files

  4. #4
    Sr. Software Engineer filker0's Avatar
    Join Date
    Sep 2005
    Location
    West Virginia
    Posts
    235
    I'll take a look at the documentation this evening and see if I can come up with any ideas of what might be going wrong.
    Insert obnoxious but pithy remark here

  5. #5
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    Could this possibly be more of a hardware issue than a programming issue?????

    It's my understanding that COM ports share interrupts. For instance, COM2 and COM4 share IRQ3 and COM1 and COM3 share IRQ 4. Thus, COM3 and COM4 work fine because they have different interrupts. Now let's assume that both COM3 and COM4 are active and COM1 comes online. It's requesting IRQ4 which is in use by COM3. This is a conflict and COM1 fails. Ditto with COM2 and COM4.

  6. #6
    Registered User
    Join Date
    Nov 2005
    Posts
    9

    I am sold on the interupt idea...

    Okay, that sounds like it just might be my problem...

    Now, how do I "turn off" COM3 to use COM1 etc...Or use the interupt method to access the ports. If anyone could give me an C example or instructions that would be great. I have found some articles on the internet about interupts however I can't find any good source code with good comments which expains exatly what is goin on. Thanks for the help!!!!

  7. #7
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    I did take a look at the attached docs and it does indicate that all the COM port IRQs are uniquely defined. Thus, you do not have a conflict.

    All the other electrical engineering stuff is way over my head. So, I'm out of options.

    Good luck...

    Bob

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Duplex communication thro serial port
    By Priyachu in forum Linux Programming
    Replies: 1
    Last Post: 05-30-2009, 04:03 AM
  2. Serial port Communication
    By vin_pll in forum C++ Programming
    Replies: 23
    Last Post: 01-07-2009, 08:32 AM
  3. Serial Port - Problem with binary frames
    By estratos in forum Linux Programming
    Replies: 2
    Last Post: 01-18-2006, 05:22 AM
  4. serial port communication from two Application
    By lsme in forum Networking/Device Communication
    Replies: 5
    Last Post: 12-12-2005, 10:32 PM
  5. serial port data transmission
    By djarian in forum C Programming
    Replies: 2
    Last Post: 10-04-2003, 02:22 PM

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