![]() |
| ||
| Serial communication using DEV CPP IDE 4.9.9.2 Hello,I am doing a project in which i need to send and receive data from a microcontroller.I was trying to do this in DEV CPP IDE 4.9.9.2 but couldn't succeed till now.The following is the code i tried compiling. The code: #include <bios.h>Previously i got an error saying that bios.h couldn't be found .Then I added bios.h from a TC's include directory.Now it got compiled but when I tried running it ,I got the following errors. C:/Dev-Cpp/include/bios.h:21: error: variable or field `far' declared void C:/Dev-Cpp/include/bios.h:21: warning: no semicolon at end of struct or union C:/Dev-Cpp/include/bios.h:21: error: syntax error before '*' token Can any one tell me how to solve this.Also can any one give me some sample code or resource to read on serial communication in C using DEV CPP IDE 4.9.9.2 |
| ||
| Re: Serial communication using DEV CPP IDE 4.9.9.2 How to send/receive on serial port is operating system dependent. The code you posted was written for MS-DOS and Dev-C++ only compiles for MS-Windows. You can not use any of the code you posted with that compiler. So you might as well just toss it away and use win32 api functions. Start by reading MSDN for CreateFile function to open the serial port, then scroll down the page until you see Communications Resources. |
| ||
| Re: Serial communication using DEV CPP IDE 4.9.9.2 Quote:
|
| ||
| Re: Serial communication using DEV CPP IDE 4.9.9.2 |
| ||
| Re: Serial communication using DEV CPP IDE 4.9.9.2 XP comes with the program Hyperterminal which does this. |
| ||
| Re: Serial communication using DEV CPP IDE 4.9.9.2 Quote:
Quote:
|
| ||
| Re: Serial communication using DEV CPP IDE 4.9.9.2 If you want to confine your program for DOS only (warning: highly unrecommended!) and shun learning (warning: again highly unrecommended!) what AD said, you may try to compile this code with some MS-DOs compiler. |
| ||
| Re: Serial communication using DEV CPP IDE 4.9.9.2 I want to know why the above code i mentioned is getting compiled in TC but not DEV CPP IDE and how to make it run in DEV CPP IDE 4.9.9.2 |
| ||
| Re: Serial communication using DEV CPP IDE 4.9.9.2 AD has already answered this. Quote:
|
| ||
| Re: Serial communication using DEV CPP IDE 4.9.9.2 First of all, the mistake you have been doing is using Turbo C compiler and getting confused between code written for MS-DOS and Windows OS. STOP using your Turbo C compile and just focus on things which are more standard. >I want to know why the above code i mentioned is getting compiled in TC but not DEV CPP IDE >and how to make it run in DEV CPP IDE 4.9.9.2 You can already see from the error message thrown by the compile on Dev-C++. You have been using some non standard library which was available under TC. But, Dev-C++ doest support those libraries what so ever. And now explain us, why do you need this code. What is the main purpose of writing this code? What I understand from your post is that, you trying to use this program send and receive data between your microcontroller and your PC. If that was your main intention, there is already inbuilt terminal emulator "HyperTerminal" which does that for you. Where you can transfer your binary to your MController. If that wasn't your intention, Can you explain you what are you trying to do? And on the other hand, have a look at the links which I posted in my previous post, there is an article on how to program a serial port for Windows. Its a good Article which was taken from MSDN. If you follow that you will be able to achieve something on Dev-C++. And start thinking STANDARDS. ssharish |
| All times are GMT -4. The time now is 12:38 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC