Dear all,
I have been trying to go from storing bytes to storing bits in scratchpad memory area. I need to store 128 pieces of ones or zeros in 16 bytes for better processing options later. I was storing 128 bytes before and that works. Now, with two nested FOR loops and an IF statement, which is the way I figured I could do individual bits, I'm too slow. At least that is the only way I can explain getting all zeros no matter what from the last 64 pixels of the sensor. The old code still works, so there is no electrical problem. Sorry for no comments on this one, but it is kind of simple.
Is there a magic better=faster way of doing this?
If that does not work, is there a 'magic' way of converting 128 bytes with values 1 and 0 laying in scratchpad into 16 bits of a word variable?
Thank you for your time,
Edmunds
I have been trying to go from storing bytes to storing bits in scratchpad memory area. I need to store 128 pieces of ones or zeros in 16 bytes for better processing options later. I was storing 128 bytes before and that works. Now, with two nested FOR loops and an IF statement, which is the way I figured I could do individual bits, I'm too slow. At least that is the only way I can explain getting all zeros no matter what from the last 64 pixels of the sensor. The old code still works, so there is no electrical problem. Sorry for no comments on this one, but it is kind of simple.
Is there a magic better=faster way of doing this?
Code:
pixel_data = 0
for counter = 0 to 15
for counter2 = 7 to 0 step -1
if pinAO = 1 then : setbit pixel_data, counter2 : endif
pulsout CLK, 10
next counter2
put counter, pixel_data
next counter
Thank you for your time,
Edmunds