Question
floating point calcultations within interrupts
Posted on November 04, 2012 at 10:25
Hello,
I am experiencing some troubles recently with floating point calculation within interrupts. I have a dma interrupt running at 400 Khz in double buffer mode. I have an usart RX interrupt coming at 50 Hz. the 400khz interrupt will drive and RGB barled very smoothly. The 50Hz interrupts decodes an RC Radio signal. the 400Khz interrupt has higher priority than the 50 Hz one. in the 50Hz interrupt, I am retrieving integer values that I wanted to scale to 0 -> 100%. If I do the floating point calculation which is basic : Y = (a - offset) / Scale, this results in a very strange behaviour (Scale and offset are constant non zero values ). My whole main loop is very much slowed (from 30hz to 2Hz). Is there any issue with using floating point calculation within interrupts? The same calculation done in the main loop will not cause any issue.