Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
Hi All, I'm trying to read from a SAR6 ADC and not getting much joy. I've got the SAR6 input from a PGA, and the PGA clocked at 32kHz. The PGA and SAR6 are started and set to high power mode. The PGA gain set to 1. Then a call to SAR6_cGetSample seems to hang at; mov reg[ASY_CR], ASY_CR_SYNCEN From what I can gather, this waits for a rising edge on PHI1. Is it possible that the clock PHI1 isn't running? Any clues appreciated. James.
Check if the Analog Power parameter in Global Resources is set to "SC On / Ref xxx". If it is SC Off, then all SC Blocks are powered off and you will not get any result from ADC. Also, check if the column clock to the ADC is within the limits specified in the SAR6 data sheet. This blog also may be helpful. PSoC1 ADCs - The Five Golden Rules
Yup. SC On / Ref Low. Maybe the clock I had was too slow. I've now got VC2 at 1MHz as the clock. I find the data sheet a bit confusing in this regard. It says Fclock is Column Clock / 4. So if I choose VC2 at 1MHz, that gives Fclock of 250kHz, which is within the 32 to 333kHz range. Correct? Now it gets to the next line of code which is initialising SAR6_CR0 - and hangs there 😉 I read through the golden rules. I can't see any problem there. Any other suggestions? Cheers, James.
What power do you start the SAR6? The Analog Power should be equal to this power. For example if you start the SAR at Medium power, the analog power should be SC On / Ref Med. Also, the maximum column clock will be different for different power levels for the ADC. Check if this is within limits. Also, check if you have enabled Global interrupts by using M8C_EnableGInt.
You may also want to check out the below example project.