We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all I am using the Infineon C167 Microcontroller with Keil Environment for an Ignition Controller application. I capture positive transition of the input signal at the CapCom unit and generate, service the interrupt to set a port(port 2) high. The code which I have written in a function call from the ISR is a few simple switch case statements and some floating point calculations. But the time taken between getting a positive transition at the input and the setting of the port is nearly 700 us. Even accounting for the interrupt latency it is very large and it is above the tolerance limit for our Ignition controller. Can someone pl explain why it takes such a long time?? I checked the clock speed(20 MHz) and I have optimized the compiler to level 7. Thanks for your time Vijay
Floating point calculations are SLOW. Check out this web page: http://www.keil.com/benchmks/c16x_v5float.asp If you need speed, use integer arithmetics. - mike
Hi Mike Thanks for your help. I didnt know floating point operations took that much time! I modified the code with int arithmetic and now got it around 200 us(saved 500 us!) which is under the tolerance limit for our app. Vijay