Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   free C compiler for Windows (http://www.chiefdelphi.com/forums/showthread.php?t=98466)

Ether 26-11-2011 16:35

free C compiler for Windows
 

Hello C gurus.

Do you know if there's a free C compiler for Windows XP which has support for RS232 access, and has a sleep() function which blocks waiting (as opposed to busy waiting).



EricVanWyk 26-11-2011 18:24

Re: free C compiler for Windows
 
Not quite what you are looking for, but pyserial for python can toggle the RTS pin, if that is what you are still trying to do.

Ether 26-11-2011 18:58

Re: free C compiler for Windows
 
Quote:

Originally Posted by EricVanWyk (Post 1086780)
Not quite what you are looking for, but pyserial for python can toggle the RTS pin, if that is what you are still trying to do.

Thanks.

It's not just toggling the RTS pin that I'm after. I know how to do that.

I've written countless interrupt-driven RS232 comm test equipment apps, mostly in assembly, for older machines running DOS (where you can diddle directly with the hardware). Many of them run fine from a windows command prompt.

What I want to do is write a small 32-bit windows app that looks something like this:

void main(void){

while(1) do{
SetRTS();
sleep(10);
ClearRTS();
sleep(10);
}

}

... where the sleep() function is blocked waiting, not spinning.

I want to slap a scope on the RTS pin and watch it while I play around with Windows to see what it does to the signal under various conditions.

I'm thinking this would be a visually captivating show-and-tell for students just learning about realtime issues and concurrent processing.




apalrd 26-11-2011 22:11

Re: free C compiler for Windows
 
The Windows API for serial communication has a function (EscapeCommFunction) which can be requested to clear or set RTS state.

http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

Thus, any compiler which links to the Windows API can use it.....

I've used the VC++ compiler before (on windows), and Cygwin when building from my Linux machine. VC++ Express and Cygwin are both free. winapi also has a Sleep() function. The MSDN page on Sleep() has more information.

plnyyanks 26-11-2011 22:21

Re: free C compiler for Windows
 
Quote:

Originally Posted by apalrd (Post 1086831)
The MSDN page on Sleep() has more information.

http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

When I program C(++) on Windows, I use either Bloodshed Dev-C++ or VSC++. Both support the winapi and both are free.

Ether 26-11-2011 23:11

Re: free C compiler for Windows
 

@apalrd,plnyyanks: Thanks guys. This appears to be what I'm looking for.



jwakeman 27-11-2011 11:26

Re: free C compiler for Windows
 
I would recommend MinGW, Minimalist GNU for Windows, http://www.mingw.org/.


All times are GMT -5. The time now is 23:26.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi