Very unstable/phantom readings

Support forum for the Knock Shield designed to connect knock sensors to Arduino projects.
Post Reply
kevin
Posts: 11
Joined: 16 Jun 2020 19:13

Very unstable/phantom readings

Post by kevin » 01 Sep 2021 15:25

Hello Christian,

I'm getting very phantom readings, nothing connected to the inputs but spikes up to 100% on both channels...
What can cause this behaviour?

I just used an 8Mhz prescaler:
//Define parameters used.

Code: Select all

#define           SPU_SET_PRESCALAR_8MHz         0b01000110    /* 8MHz prescalar with SDO active. */
#define           SPU_SET_CHANNEL_1              0b11100000    /* Setting active channel to 1 */
#define           SPU_SET_CHANNEL_2              0b11100001    /* Setting active channel to 2 */
#define           SPU_SET_BAND_PASS_FREQUENCY    0b00101010    /* Setting band pass frequency to 7.27kHz. */
#define           SPU_SET_PROGRAMMABLE_GAIN      0b10101111    /* Setting programmable gain to 0.222. */
#define           numberofCylinders              4             /* Defines the amount of cylinders for calculating engine speed. */
#define           SPU_SET_INTEGRATOR_TIME        0b11001010    /* Setting programmable integrator time constant to 100µs */
#define           KNOCK_THRESHOLD_LEVEL          204           /* Setting knock LED level, max value of 255. */
#define           MEASUREMENT_WINDOW_TIME        3000          /* Defining the time window of measurement to 3ms. */

Serial printout:

Code: Select all

Channel 1: 17% - Channel 2: 17%
Channel 1: 16% - Channel 2:  3%
Channel 1:  3% - Channel 2: 17%
Channel 1: 17% - Channel 2: 17%
Channel 1: 17% - Channel 2: 17%
Channel 1: 17% - Channel 2: 17%
Channel 1: 17% - Channel 2: 100%
Channel 1: 100% - Channel 2: 35%
Channel 1: 35% - Channel 2: 17%
Channel 1: 17% - Channel 2: 16%
Channel 1: 31% - Channel 2: 100%
Channel 1: 28% - Channel 2: 17%
Channel 1: 17% - Channel 2: 17%
Channel 1: 17% - Channel 2: 17%
Channel 1: 16% - Channel 2: 100%
Channel 1: 100% - Channel 2: 38%
Channel 1: 17% - Channel 2: 31%
Channel 1: 31% - Channel 2: 31%
Channel 1: 31% - Channel 2: 31%
Channel 1: 31% - Channel 2: 31%
Channel 1: 31% - Channel 2: 31%
Channel 1: 17% - Channel 2: 17%
Channel 1: 17% - Channel 2: 17%
Channel 1: 17% - Channel 2: 17%
Channel 1: 100% - Channel 2: 16%
Channel 1: 10% - Channel 2: 10%
Channel 1: 10% - Channel 2: 17%
Channel 1:  1% - Channel 2:  1%
Channel 1: 16% - Channel 2: 30%
Channel 1: 30% - Channel 2: 100%

User avatar
Christian_Bylund
Posts: 270
Joined: 07 Mar 2015 18:09

Re: Very unstable/phantom readings

Post by Christian_Bylund » 01 Sep 2021 15:31

kevin wrote:
01 Sep 2021 15:25
Hello Christian,

I'm getting very phantom readings, nothing connected to the inputs but spikes up to 100% on both channels...
What can cause this behaviour?

I just used an 8Mhz prescaler:
Hi Kevin,

The prescalar need to match the oscillator which is 6MHz.
Best Regards,
Christian Bylund
Bylund Automotive AB

kevin
Posts: 11
Joined: 16 Jun 2020 19:13

Re: Very unstable/phantom readings

Post by kevin » 01 Sep 2021 15:39

sorry forgfet to mention the oscilatoor is also 8Mhz ;)

User avatar
Christian_Bylund
Posts: 270
Joined: 07 Mar 2015 18:09

Re: Very unstable/phantom readings

Post by Christian_Bylund » 01 Sep 2021 17:58

kevin wrote:
01 Sep 2021 15:39
sorry forgfet to mention the oscilatoor is also 8Mhz ;)
Sorry, we do not support custom designs on this forum. But it seems your DSP is not initialized properly.
Best Regards,
Christian Bylund
Bylund Automotive AB

Post Reply