Question
Super real-time application optimization
Posted on September 28, 2012 at 19:28
Hello, I've been wondering about upgrading to the STM32 from an ST10. It's imperative that certain thing are as close to instantaneous as possible. I was thinking I've identified two bottlenecks and two solutions. Tell me what you think. Any further optimization idea are welcome
Bottleneck 1: Interrupt Service Routine running from flash will suffer from instruction loading latency. Solution 1: Load Interrupt Service Routine into SRAM at program initialization. Put jump vector reference to SRAM, so instruction in ISR actually executes at 168Mhz with no memory latency or wait states. BottleNeck 2: Multiplexed ADC means I have to wait until every analog signal is done being read, and then having the program react. This means the program can only change its output after (conversion time)*(number of analog signals) seconds. Solution 2: Turn the analog signals into PWM signals before it gets into CPU, then get all PWM inputs into CPU in parallel through the capture inputs. If the PWM runs at about 20kHz, then I feel comfortable updating all the output every maybe 50us. Maybe I could run the PWM frequency up to 200kHz, and I could get all the analog input into the CPU every 5us?? #adc-latency-flash-optimization