Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use RS232 transmitter interrupt using C?

Status
Not open for further replies.

thangaduraibeece

Junior Member level 2
Joined
Jul 4, 2008
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,419
#use rs232

Hi,
I need to use a transmitter interrupt and receiver interrupt in C.
I coded same but its working sometimes and not wrking remaining time.
If anyone thinking of help me,then i will post the code....Please reply me...It urgent help....
 

why should i use rs232 interrupt

Hi,
It is difficult to know what your problem is as you have said nothing at all about the hardware you are trying to use? Please tell us more.
Bob.
 

interrupt in c task

In windows I believe the interrupt would be handled as an event and you would get a message from the OS in a callback function. You do not handle the interrupt yourself unless you want to write and install the device driver for the serial port yourself. And then you are into a whole new ball game. With the MSComm ActiveX object I think it is just an OnComm() event.
 

using the rs232 port in windows c programs

In C program running on my PC having windows OS, i want to transmit a three byte through RS232.I am transmitting the data in the following way:

/******************/
usigned char noofchars = 3;
//temp is a pointer to an array containg the three 1 byte data
while(noofchars)
{
outportb(PORT1, *temp);
temp++;
noofchars--;
}
//Note: I have disabled the FIFO enable bit
/**********************/

For this the three data are transmitted continuously at some time when i check the bits using CRO and sometimes the first data are transmitted continuously and there is a time gap of around 5 millisecond and then the next byte is transferring.
I dont know the reasons why this is happening.
 

rs232 transmitter program download

Hi,
If the gap is only about 5ms and then the transfer continues it is probably just due to the windows operating system interupting your program to do something else that its creator considered more important. Is a 5ms pause a problem to you? This sort of thing happens all the time under Windows.
Serial port handling under Windows is a low priority task as far as the operating system is concerned so many other system tasks are able to interrupt it. I do not think there is actually anything wrong with what you have done, it may be possible to change the priority of your program so that it has first call on the system resources if this is a time critical application, I know this is possible but personally I have never actually done it yet so cannot advise you as how to do this. I do not believe this is due to any system interrupt handlers not working correctly.
Bob.
 

interrupt rs232 windows

Hi,
I am replying you after my testing.
Actually the time between two bytes are getting varied and not is being a constant time gap.
What i observed is that it varies from 3 milliseconds to 120 milliseconds.
What i am worrying is that i can tolerate a time delay of 5 milliseconds in my application.but it is varying up to the max of 120 milliseconds.
I have a doubt that will it be solve when i run this application in pure DOS rather than running in windows or in command prompt of windows OS.
Whats ur idea?
 

#use rs232 interrupt

Hello,
What you have found does not surprise me. Running under a Command prompt with the current versions of Windows will make no significant difference to the delays you get as this is really still your program running under Windows. If you have a machine running pure DOS I would expect you will have less delays but I have not really got much recent experience of working with the serial port under DOS.
regards
Bob.
 

rs232 interrupt in c

Hi Bob,
I worked today with the tolerance of such delay(120 ms).As your advise i planned to try it in a machine running in a DOS environment tomorow.
I have one more doubt is there any possibilty to set the priority of the application while running in windows.I found there is an facility in Windows to set the priority manually from task manager window.I planned to run my test by setting high priority tomorrow and let u know.If it works fine, i have to set the priority from the C code in my application rather than changing it in the task manager window since the user has to set the priority when ever he close and reopen the application.Because the priority will be reset once the application gets closed.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top