Home/Support/Support Forum/Serial ISR in µC/OS-II
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Serial ISR in µC/OS-II

0 votes
I want to send data and receive data via serial with μC / OS-II. Are both task must be created separately using two tasks, one task for transmit and one task for receive using the TA-ISR? Or Is possible use single task? What is best design for reducing interrupt latency? Thank you.
asked Jun 6, 2015 in Rabbit Software by edha Community Contributor (71 points)

Please log in or register to answer this question.

1 Answer

+1 vote
Best answer
The same task can be used for send and receive on a given serial port. There is a limitation in terms of multiple tasks sharing a serial port where it can only safely be done if one is sending and the other receiving.

I had seen some problems with older versions of the DC libraries and compiler (DC 10.66) which required setting the serial interrupt to the highest priority to avoid crashes and this had an impact on network operation but I've been using uCos/II and serial comms with lower priority serial interrupts with DC 10.72 and those problems seem to have been resolved.

answered Jun 8, 2015 by petermcs Veteran of the Digi Community (1,132 points)
selected Jun 8, 2015 by edha
Thank you sir for the very useful information. DC10.56 for Ta-ISR still using zilog assembly. Sometimes my code freezes, must be an additional delay to switch to another task, maybe context switches does not work perfected.
In contrast to DC10.72 all smoothly. Ta-ISR is also using c(assembly hidden), more easily understood. Context switches does work perfected. Now i turn to the DC 10.72, after seeing a more stable and easier for uC/OSII. Thank you
Reception of data into one centralized tasks("isr_task") such as in the "C:\DCRABBIT_10.72\Samples\uCOS-II\ucostaisr.c".

If i send data out to other device over a serial port from the two different functions (eg "first function" and "second function"), then rabbit will receive all the replies from other device  centrally in isr_task.

How isr_task could distinguish that incoming data is reply of "first function" or "second function"? I want to make sure that the serial data received in isr_task are the property of functions that send data out(function caller). Is possible we get information about function sender/function caller in isr_task when signaled semaphore occured in isr_task?
You would need to have some sort of identifier in the serial protocol which can be used to track which response belongs to which query. Is this your own protocol or a standard one such as Modbus or BACnet?
I use rcm5600w to communication with petrol dispenser mainboard with BSC protocol. The petrol dispenser use BSC protocol, so i had to follow that. Maybe I could use a BACnet for communication rcm5600w to the local server. Thank you.