colorchord icon indicating copy to clipboard operation
colorchord copied to clipboard

Interference with ADC in station mode (SOLVED)

Open bbkiwi opened this issue 7 years ago • 3 comments

With the latest commit 095ca using latest esp82xx, I get spurious signal into the ADC when in station mode and connected to the gui. This does not happen when connected to the gui in AP mode or when not connected to the gui in either mode.

The interference seems to start about 4 min after connecting to the station. Initially the oscope shows no glitches but they develop after a time. My real oscope at A0 does not show any blips even when they show in the gui oscope.

I've made a video showing what happens. https://youtu.be/5993kTh8T9I

Here is what the oscope looks like when AP starts https://youtu.be/6JzNtNrRPF0

bbkiwi avatar Jun 28 '17 04:06 bbkiwi

SOLVED!

I noticed that in station mode with gCOLORCHORD_ACTIVE = 0, the oscope still works slowly partially responding to the audio! It should be stopped (as it dones in AP mode)

Add at line 134 to user_main.c hpa_is_paused_for_wifi = 0; // only need to do once

As it stands now hpatimer is started repeatedly. I still don't understand why the oscope shows about vcc/3 with no audio when it should be vcc/2. Now both in AP and Station mode when switching from inactive to active it shows vcc/2 briefly then drops down to vcc/3. See 10 sec clip https://youtu.be/YFQ61COEGs8

I put vcc (3.3v) on A0 and the oscope shows about 2/3 up which is consistent with vcc/2 being 1/3 of scale.

bbkiwi avatar Jun 29 '17 03:06 bbkiwi

It could be some of the other problems when cc interacts with esp82xx are related to ExitCritical() being called too soon after changing to station mode (in commonservices.c). Rather than call ExitCritical() maybe make hpa_is_paused_for_wifi visible and set it to 1.

bbkiwi avatar Jun 29 '17 05:06 bbkiwi

WOAH I know this is a blast from the past, but I am cleaning out old issues!!! I DID NOT SEE THIS!

How does that work? I am so confused by this!!! I figured it was just EMI from the rest of the system.

Does it still happen in the current trunk? Your oscope is so clean.

Hoping to reopen discussion on this.

cnlohr avatar Sep 09 '17 14:09 cnlohr