| ??? 06/05/02 15:25 Read: times |
#23960 - RE: pantyhose |
Erik:
600khz is real fast even for assembly. thats 1.67 usec. i dont know the details or requirements of your project but lets leave your big experience behind(just while you read my post plz not any longer!) and lets use common sense. U must agree with me that when i put TR1 = on; timer starts runing same time regardless if this bit was set by assembly or by efficiently compiled c. The thing is i'm using the hardware timer to start my timing not c nor assembly. what i will do is have timer1 set to interrupt every 1.6 usec (of course you have to choose a fast 8051 member coz your speed requirements are real tight) in the ISR i pump out the 4 bits(parallel) or 1 bit (serial) to the port and job is done! so it wouldnt make much difference if i used c or assembly! The only difference when the interrupt occurs c might save more registers on the stack than assembly giving some more delay but i'm sure there is some way you can control that. i used a slow processor (0.5usec per instruction cycle) and used timer 1 to interrupt every 52 usec for 19200 BPS and used parity bit also and had no problems what so ever in receiving and processing this data with pure c while my circuit is doing all other stuff mentioned in my first post at the top. I didnt try it for higher baud rates to see how far i can push my luck with c coz the goal was to accomplish my job and not speed test. Conclusion is if you put your mind to it you can process data real fast in c and close to the speed of assembly! If you dont beleive it pay me and i will do your job for you! Best regards Mahmood |



