Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/03/02 09:33
Read: times


 
#33642 - RE: Simple 8052 O/S
hi;
i used to think mis-interpreting my name was localised to india.so far i have had "pranav" written as pranay,pranoy,pranab,parnav.now you have joined in with pranesh.so i guess i am a globally misunderstood person:-)

First let me agree with others that using ring buffer and using a non-os approach would
be more suitable in this case.far less timing/processing overhead and more DATA/IDATA to
play with.you can easily accomodate both the tx and rx buffers because now you have a
single task overhead only.

the other thought: can we still persist with rtos and manage?

you basically need to monitor incoming charecters (max3 in a group) and send a reply.
from all we have discussed a circular buffer looks best.lets say you recive charecters
analyze them and prepare your reply in RX handler.so RX handler acts as writer and TX
handler is reader which is the TX isr itself.RX handler shall write to circular buffer and TX isr shall remove it.we basically need 2 bytes for read/write pointers and 1 for no.of charecters in buffer.then we need consecutive "n' bytes which is circular buffer depth.

you can also have a small buffer for incoming bytes which you need to analyze.

after a 3 byte group is assembled by RX handler you analyze it.the overhead is known
to you only.the reply is prepared.while writing you do something like this:


;disable interrupt to prevent simultaneous access by tx isr
;increment byte_counter
;acquire read pointer
;load 3 bytes and update pointer
;if tx_on flag is set do nothing reenable interrupt
;if not setb ti and reenable interrupts



sending out the reply would be similar:
;check any bytes are pending if no, clear tx_on flag and return
;if yes decrement byte_counter
;acquire read pointer
;read bytes and update pointer
;reenable interrupt

the rtos you are using has seperate stacks for tasks.the load of switching is less anyway.it
can be reduced further if you decide to use separte register bank for each task.that reduces
switching time by a whooping 32 microsec if you can tell your compiler to do that.

you said that timer isr takes about 100 microsec.sounds far too long for a 3 task syastem.
have a byte each to identify task state.keep to more bytes to store running task id and
scheduler task id.by simple comparisons you can make all your decisions and shall easily
shed atlast 50 microsec from that 100 microsec.

the big problem is how much buffering can be provided after rtos is implemnted?
will that be sufficient?
that can be answered by you only.


a long one again
pranav















List of 30 messages in thread
TopicAuthorDate
Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S @ erik            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S @ Erik            01/01/70 00:00      
RE: Simple 8052 O/S @ Erik            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      
RE: Simple 8052 O/S            01/01/70 00:00      

Back to Subject List