??? 01/15/08 14:54 Read: times Msg Score: 0 +1 Good Answer/Helpful -1 Message Not Useful |
#149473 - Math in Interrupt Context Responding to: ???'s previous message |
Saying that the math must be done in the Interrupt context is not really correct. It may also be incorrect to even try to do the math in the interrupt routines depending on the timing involved. This type of math can take a long time to perform if it is being done via software routines and may make there end up being illegal timing to your SMBus device. The typical MCU SMBus peripheral puts the serial bus into a clock stretch between transfers while the MCU sorts out its interrupt routine.
There is almost always a way to architect an alternate scheme to perform slow calculations such as this type of math in your mainline code and then deposit the results into global variables which the interrupt context can use to provide results back to the other device on the SMBus. It is often typical that results that involve more complex computation are not needed on high bandwidth demand basis anyway. One simple scheme may be that the mainline code periodically performs an algorithm and produces a calculated result. This result is then available if needed when an SMBus request arrives. Michael Karas |
Topic | Author | Date |
32bit divide and mult Not using the Libraries? | 01/01/70 00:00 | |
Hm, as far as I can see ... | 01/01/70 00:00 | |
Yes 24 bits | 01/01/70 00:00 | |
is there any predictible relationship between... | 01/01/70 00:00 | |
Math in Interrupt Context | 01/01/70 00:00 | |
SMBus clock stretching | 01/01/70 00:00 | |
Slicing Prob Not Necessary | 01/01/70 00:00 | |
True except for AT RATE | 01/01/70 00:00 |