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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/02/02 17:04
Read: times


 
#33576 - RE: Simple 8052 O/S
Pranesh, it's not boring (to me) ... thank you for your analysis of the problem, and your help.

comments :

1. yes, reason I chose to have TX as high priority is because it never has to wait for resources (it just does some decisions and feeds the UART). It is never blocked, so no possibility of deadlock. I would like to put this straight in teh UART isr ... I just realised I can trigger TX from app by loading the buffer and clearing TI and a flag (so that TX task knows the int came from app not the UART). That would free up 22 bytes and make latency less - whoopee!! BUT ...

What will happen if UART happens to finish TX-ing a character while the ISR is running? Or even at the EXACT same moment that the app code clears the bit? Whoops, very intermittent failures because ISR cannot know when UART is free ... impossible to find out or test for and risky I think. Can't expect poor chip to know about that. (un-whoopee.)

(Idea : unless I make a 'UART free' bit be maintained by the UART ISR ... the app code does not clear TI unless this is true. OK, I think that can work. If buffer is >1 they can still feed a free slot, no problem.)

2, 3. Right now Rx int is setting a flag, all context switching happens in timer ISR. You are right about context sw taking about 60 us ... but scheduler does more than look at 3 flags. He has to say
- is highest pri task running - yes: return
- is #2 task prempted or requested -: yes - return or sw to #2 task as appropriate
- same thing for #3

... so that ends up being a bit more work. I think that worst case ISR is about 100us ... but that can be improved. Some is not efficient because doing things in C that are better in asm.

But you are right, Rx task switch should definitely happen in RX int, just to maximise the ammount of time available to process the char.

Then if both TX and RX are sched'd from ISR, Timer int (higher pri) can be less often and simpler, so less load. Nice!

(Although I want 8052 for that so it can use 16 bit ctr for ISR.)

Thanks again for help. You help me to work out how to do all this.

Daniel


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