Buzby
Senior Member
Hi hippy,
Here is another of my half baked ideas. I'd like to try it for real, but I'm 200 miles away from my hardware. ( Rush packing, I forgot my toys )
Regarding reading the pixels in, your tests show 'for / next' takes 40mS, and unrolled '@ptr= : pulsout CLK' takes 20mS.
How would you like to see a way to drop that to 10mS, or maybe significantly less ?
I think you could use hspi.
spi sends a clock train out, and reads the data in synchronously, so it should be possible to read the digital input much faster. You might need to bit-bang the first CLK, as SI needs to be reset at that time, but the rest is just clocks.
I'm sure this would work fine if you are reading the data as digital, but what if, like me, you are reading the analogue values ?
Time for an even less baked idea !
The CCD doesn't mind having the CLK running all the time, it only springs into action when SI goes high.
So, start HPWM clocking the CCD. ( Do this in the init code so it stays running. )
The actual sensor reading code is :
pulsout SI
@ptr=readadc
@ptr=readadc
@ptr=readadc ... 128 times
The trick is to have HPWM clocking the CCD at the same rate that the string of @ptr=readadc's is filling the scratchpad. You will probably need to select which HPWM phase to use, and you might lose a pixel at the beginning, because of SI. ( There might be a way round this on an 'M', maybe something using that Digital Signal Router. )
Now I know there also maybe issues with the 'unpredictable execution time' of PICAXE instructions, but the odd wrong scan is a small price to pay if you can repeat the process 1000 times per second !.
I won't be able to test these ideas till Sunday, but they're interesting, so what do you think ?
Cheers,
Buzby
Here is another of my half baked ideas. I'd like to try it for real, but I'm 200 miles away from my hardware. ( Rush packing, I forgot my toys )
Regarding reading the pixels in, your tests show 'for / next' takes 40mS, and unrolled '@ptr= : pulsout CLK' takes 20mS.
How would you like to see a way to drop that to 10mS, or maybe significantly less ?
I think you could use hspi.
spi sends a clock train out, and reads the data in synchronously, so it should be possible to read the digital input much faster. You might need to bit-bang the first CLK, as SI needs to be reset at that time, but the rest is just clocks.
I'm sure this would work fine if you are reading the data as digital, but what if, like me, you are reading the analogue values ?
Time for an even less baked idea !
The CCD doesn't mind having the CLK running all the time, it only springs into action when SI goes high.
So, start HPWM clocking the CCD. ( Do this in the init code so it stays running. )
The actual sensor reading code is :
pulsout SI
@ptr=readadc
@ptr=readadc
@ptr=readadc ... 128 times
The trick is to have HPWM clocking the CCD at the same rate that the string of @ptr=readadc's is filling the scratchpad. You will probably need to select which HPWM phase to use, and you might lose a pixel at the beginning, because of SI. ( There might be a way round this on an 'M', maybe something using that Digital Signal Router. )
Now I know there also maybe issues with the 'unpredictable execution time' of PICAXE instructions, but the odd wrong scan is a small price to pay if you can repeat the process 1000 times per second !.
I won't be able to test these ideas till Sunday, but they're interesting, so what do you think ?
Cheers,
Buzby