2015-02-04 02:10 AM
Dear sir/mam
As i am working on data acquisition project , i am facing the timing problem and i am not able to access complete data from the simulator for the transmission speed of 10 KHz and above , data is missing frequently , so i am planning to go for Assembly language instead of C-programming, i need your help regarding this, i will update the developed code plz have a look at it
i want the below for loop to be converted to ASM, i kindly request you to help me regarding this issue at the earliest
for(i=0;i<=23;i++) // inner for loop to make a byte
{
signature2_byte=signature2_byte<<1;
signature2_byte=signature2_byte + signature_bit_array2[l];
l++;
}
regards
2015-02-04 02:32 AM
Can you post the resulting assembly compiled for this part of the code ? Generally compiler are not very bad, excepted for anticipating loads. I recommend to understand what the compiler does and then try to remove bottlenecks.
Did you try a better algorithm ? if signature_byte_array2 only hold ones and zero, it could make sense to pre-compute the signature for every combination of 8 bits from signature_byte_array2 and your loop could be reduced to 3 iterations ... well, no iteration at all because it can be un-rolled. -- laurent2015-02-04 03:11 AM
dear gonzalez
I thank you and appreciate for your immediate response , i will explain you the requirement and i will update the developed code plz have a look at attach file, what i am doing on my code is i am receiving the pulse form port on clk interrupt , i will collect all the pulses like 0s and 1s to form a byte , this will continue till i receive 128 bytes along with the SOF . the code i working from 1khz to 9 khz after that like 10 khz etc the data is missing and i am not able to match the SOF with the received pulse , and the pulse are missing. ________________ Attachments : 3_TDAS_ARM_USART.rar : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I03v&d=%2Fa%2F0X0000000bSw%2FG3ym0ZldZSkflTsCU6bmMp3vsvHwtNLyqKVoln75q0w&asPdf=false2015-02-04 05:41 AM
So IRNSS data.
You could unroll it. Code could do with a substantial rethink, perhaps holding the incoming bit stream in a 32-bit word, and masking it. Holding everything in bits, and then mapping it back and forth seems a bit amateurish and slow. Converting this one routine to assembler might help speed slightly, you'd do much better if you fixed the algorithm so there was less wasted effort.2015-02-04 12:34 PM
Just another thought - you may consider using the bit-band region for storing the bit array. Then the data could be accessed at word basis from the SRAM area and vice versa without any conversion.
2015-02-04 09:13 PM
Thank you for the response and now what i should do,if you don't mine can you please explain briefly and i am struggling in frequency like above 10khz is not working give me some idea.
2015-02-04 09:39 PM
2015-02-06 09:53 PM
Dear clive
As you said to collect all the bit and then compare, i have totally 128 bytes how to collect all the 1024 bits and compare with the SOF, in some case there will be an bit shift in order to match the Frame i need to left shift the bit frame , i kindly request you suggest me with some technique2015-02-07 04:29 AM
Like I said you need to do this differently, where you shift bits in a register, search for sync when you're out-of-sync, and confirm the framing sync/preamble when you are in sync.
Use a state machine. As you receive each bit, shift it into a register (the processor uses 32-bit ones, so that's pretty efficient), as you accumulate enough bits for a byte write that to your buffer, check the sync word at your byte/frame boundary, and if you are not in sync then check your sync word at each bit shift, by masking of the relevant 24-bits and comparing them. If you do this on the fly, the achievable throughput will be significantly higher than trying to assemble and handle dozens of bits/bytes during a single bit time/interval. I don't think bit banding is useful here. Review also the concept of local/auto variables, static variables in functions, and other applications processing bit streams.