Speaker noise on GO.lcd.clear();

Post Reply
gritshelor
Posts: 8
Joined: Mon Feb 24, 2020 6:04 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 0
Contact:

Speaker noise on GO.lcd.clear();

Post by gritshelor » Thu Mar 12, 2020 7:01 pm

Hi lovers of the Odroid,

I have an issue with a ticking(?) sound when I use GO.lcd.clear();
Is this a normal behaviour?

I noticed it while using espnow to send some data and I need to clear the display all the time because I want to see the data on the display.

gritshelor
Posts: 8
Joined: Mon Feb 24, 2020 6:04 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Speaker noise on GO.lcd.clear();

Post by gritshelor » Fri Mar 13, 2020 7:10 am

I think it is the Speaker.update() function when I try to read the buttons with Go.update() from an example... I think I'm going to read the buttons one by one.

Code: Select all

void ODROID_GO::update() {

    //Button update
    BtnA.read();
    BtnB.read();
    BtnMenu.read();
    BtnVolume.read();
    BtnSelect.read();
    BtnStart.read();
    JOY_Y.readAxis();
    JOY_X.readAxis();

    //Speaker update
    Speaker.update();
    battery.update();
}

User avatar
crgimenes
Posts: 3
Joined: Wed May 13, 2020 9:31 pm
languages_spoken: english
ODROIDs: Odroid-Go
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Speaker noise on GO.lcd.clear();

Post by crgimenes » Wed May 13, 2020 9:36 pm

I have the same problem here.
Whenever the screen is updated, the speaker emits a small noise.
I'm looking for other codes that don't have this problem to see what is different and correct my project.
This problem only happens with my code made in the Arduino IDE, emulators and other applications do not have this problem.

A code example that generates the problem here is "Hello, ODROID-GO" in the wiki page https://wiki.odroid.com/odroid_go/ardui ... ello_world
I am currently compiling as firmware (.fw file)
Cesar Gimenes
https://crg.eti.br

User avatar
crgimenes
Posts: 3
Joined: Wed May 13, 2020 9:31 pm
languages_spoken: english
ODROIDs: Odroid-Go
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Speaker noise on GO.lcd.clear();

Post by crgimenes » Thu May 14, 2020 9:57 pm

I investigated the problem some more.

If I create an empty sketch with only the setup and loop functions, the noise problem does not appear.
But if I create a sketch and just call GO.begin() the noise appears.

Example:

Code: Select all

#include <odroid_go.h>

void setup() {
    GO.begin();
}

void loop() {
}
I also tried to manipulate the microphone's volume and the brightness on the display but that didn't change the noise.
As soon as I have the time I will investigate the library code and try to find out what is causing the noise.

Any ideas?
Cesar Gimenes
https://crg.eti.br

User avatar
crgimenes
Posts: 3
Joined: Wed May 13, 2020 9:31 pm
languages_spoken: english
ODROIDs: Odroid-Go
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Speaker noise on GO.lcd.clear();

Post by crgimenes » Thu May 14, 2020 11:34 pm

The GO.bigin() function calls the Speaker.begin(), which sets the speaker channel with pinMode(25, OUTPUT) and digitalWrite(25, HIGH).

To solve the problem I wrote my own startup routine that does not open the speaker channel since I will not use it for now.
Then I can write a routine to set pin 25 to low when I want to mute the sound.

To reproduce the noise problem use the follow code.

Code: Select all

void setup() {
    pinMode(25, OUTPUT);
    digitalWrite(25, HIGH);
}

void loop() {
}

There must be more interesting ways to solve the problem, but for now at least I'm not hearing the nasty buzz in my experiments anymore.
These users thanked the author crgimenes for the post:
odroid (Fri May 15, 2020 9:10 am)
Cesar Gimenes
https://crg.eti.br

Post Reply

Return to “Arduino Coding Camp”

Who is online

Users browsing this forum: No registered users and 1 guest