Hi! I have a problem with a program in C for serial comunication under RTX-51. I have 2 task, the first is reading from serial port and i need to save the "char" in a share memory for the next task can to take it and start operating. How can i do it? Thanks
I would expect the manual for RTX-51 to contain similar information as the manual for the ARM version of RTX.
You either implement a ring buffer with a read position and a write position, letting the two tasks interact without stepping on each others toes. One task owns the read position and one task owns the write position. Or you make use of messages and send received characters to the consumer.
mr erik malard says rtos on -51 is stupid and cannot be used.
surely you mean Mr. erik malund...! malard sounds like the name tooth paste or an anti wrincle cream, or maybe a face lift in swedish :) :)
I meant "wrinkle", of course...
The '51 chip isn't the best suited for an OS. But if someone really do want to use one, it is possible even if sub-optimal.
If this is a school assignment, the '51 chip will suffice for the conceptual test. However, in real life you do not make use of any task to receive any serial data. You use an ISR to pick up the characters. Then you decide if the main loop - or a task - should process the received characters.
Erik does not say that it cannot be used.
Of course an RTOS can be used - but it is quite unlikely that anything suited to an 8051 will need to use one.
It is also debatable whether anything suited to an 8051 will benefit from using one.