This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Improving loop timing and const storage

Other Parts Discussed in Thread: DRV8305

I'm working with a F28027F+DRV8305 combination board.  Everything works, except I'd like to make the main loop faster to better manage some of my communications code.  My project is based on lab11 and the main loops has a period of ~700uS.  I tracked down the main cause for this delay to the updateGlobalVariables(EST_Handle handle) function.  In particular these calls:

gMotorVars.Rs_Ohm = EST_getRs_Ohm(handle); //142uS

gMotorVars.Lsd_H = EST_getLs_d_H(handle); //143uS

gMotorVars.Lsq_H = EST_getLs_q_H(handle); //142uS

gMotorVars.Flux_VpHz = EST_getFlux_VpHz(handle); //142uS

So my question is, can I simply remove or decimate some of these calls to increase loop performance?  Or are they all necessary?  If I can't remove any of these calls I can fix the comms issues with some extra buffering.

Also for some of my communication code I use this array:

unsigned short CRC16_LUT[256] = {

0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40....}

This array is only a lookup for a CRC calculation and does not need to be modified.  Everything works as is, however if I make this array const it no longer works.  How can I store this in flash so my functions can read it properly?