| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
how to program for serial port in C
|
Original Message
|
Name: Prashant
Date: November 7, 2003 at 06:22:17 Pacific
Subject: how to program for serial port in COS: DOSCPU/Ram: 128MB |
Comment: how to read serial port in C language. printf("%d", inport(0)); outportb(0, 65); delay(1000); printf("%d", inport(0)); supposing initial value at serial port is 64. Both printf's display 64 only. When u run the program again, then it shows 65. somebody please help me.
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: borelli35
Date: November 7, 2003 at 12:48:16 Pacific
|
Reply: (edit) ======================================================== Some code here must be missing. First, what is the overall project objective? Second, post more complete code. You do not show where you call from the UART port directly and this is what must be done (2F8, 3F8 etc...depending upon what com port you are trying to actually work with --- or is this supposed to be flexible so that the application can use any available serial port?).borelli35
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: elric
Date: November 8, 2003 at 02:01:27 Pacific
|
Reply: (edit)G'day, Yes Borelli35 is correct, you need to be more specific. So, try this link: www.lvr.com and follow the serial port links. One I found that might give you some more insight is: http://www.beyondlogic.org/serial/termpoll.c If you are using DOS, then these examples may be of some benefit, but there is also a tutorial there on using Windows API calls for 32 bit apps.For WIN Me and above I think you need to use either API calls or DLLs, and that is another thing altogether... Good Luck, Elric
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: prashant
Date: November 8, 2003 at 04:23:25 Pacific
|
Reply: (edit)I have just started programming for serial port and don't know much about it. Can u pls guide me how to start programming for it. I posted the code, but that's what I was trying to check as beginner. Please help me.
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Programming Forum Home