Hello,
i am wondering if there is a possibility to directly save a 32 bit result into a long ( 32bit) variable.
The reaons why I ask is the follwoing:
I have a serious timing issue on my application. I am reading out a detector array with 512 pixels.
For every Pixel i am doing an AD-conversion which right now takes about 13 ADC-clock cycles of 5 MHzw hich is around 2,6 µs.
The timing for the detector array read out process is set to 250 kHz each Pixel, so i have about 4µs to do an conversion and afterwords some mathematics like MPY untill the new Pixel is to be read out.
Do the math: 4µs - 2,6 µs = 1,4 µs
In this time i am doing some MPY action, which, regarding the datasheet, sould not take longer than max. 7x MCLK.
Here is part of my Code:
do
{
while ((ADC12IFG & ADC12IFG2) == 0);
TEMP = ADC12MEM2;
MPY = TEMP;
OP2 = array[Schleifenzaehler];
//uint32_detector_array[Schleifenzaehler] = RESHI;
//uint32_detector_array[Schleifenzaehler] = uint32_detector_array[Schleifenzaehler]<<16
uint32_detector_array[Schleifenzaehler] |= RESLO;
Schleifenzaehler ++;
}while (Schleifenzaehler < 513);
As you migth realize i already tried out some different settnigs for a 32 bit result. Now i have meassured the Clock cycles in Debug mode via CCS:
With the above setting I get around 29 MCLK cycles = 1,16µs
When I comment in my 32bit shifting operation with RESHI and << operator it will take 44 MCLK cycles = 1,6 µs, which theoretically wont fit into my spare time of 1,4 µs.
So finally coming to my question, is there any way of doing this calculation directly into an 32 bit register so i do not have to do the shifting?
Is the cycle counter in CCS trutable or should I assume that bitshifting is way faster then i actually think it is?
There is the option to longer my timings, but I would rather like to do faster math of course.
Thanks for reading and helping.
Best wishes, Seb