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
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.
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!!!!