View Full Version : ADC.spin implementation question and maybe prop2 instruction request

Brian H
12-30-2009, 10:01 AM
Is there·a spin·example of using the ADC.spin object? The microphone examples seem to be asm modifications, but don't appear to directly use the ADC.spin as a reference.

In the asm, the new sample value is differenced from the last value and the phsa register. Couldn't a couple line be saved if the phsa register was cleared immediately after being copied to asm_sample?·Is the issue·some kind of·loss of the data captured in the four cycles between the read and the clear?

I was looking through the manual for a read and clear instruction. (copies the value of one bit/register into another and clears the source bit/register all in one instruction). This type of instruction might address the time delay issue from teh above (assuming that's the issue). In other languages I've used for process control applications, this instruction gets used lots to handle requests for a process or algorithm to execute exactly once per request·(kind of like using positive edge triggers, but without having to write all the clearing instructions). Assuming I didn't miss it, could it be considered for the prop2? For the project I have in mind, I can really see a lot of use for it.