| ??? 12/02/02 14:09 Read: times |
#33565 - RE: Simple 8052 O/S |
hi;
i agree that it would be a good idea to have a ring buffer.my point(s) is this: 1.you have assigned the tx task highest priority.that is under your control and a small jitter on echo application should be acceptable. 2.lets say you make rx highest priority.for a sepearate task system context switch involves pusing regs,run scheduler,pop regs and ret.a typical register set for compilers is a,b,psw,dpl,dph,r0-r7:13 bytes.at 12 MHz with /12 core thats 24 microsec in push and pop=48 us.lets add something for return and isr branching latency.say total is 60 microsec. 3.your scheduler is handling 3 tasks.say you have assigned 3 bits for task being active. timer isr should have atleast three jb instructions+preemption+storing of stack+relaod of timer+storing of sp and preemption via push,push and reti. That is about 30 microsec. 4.so after every tick you need about 100 microsec for task switch. instead doing these calculations in timer isr you can simply invoke them as seperate code after every interrupt you recive and you should be able to read the charecters intime. interpreting 3 charecters and putting a byte in outgoing buffer can be done after this acquisition. sorry for a lengthy and boring reply. pranav |



