Forum: Mikrocontroller und Digitale Elektronik SAMD21 (Arduino): Mikrofon und Lautsprecher über 1 x I2S


von Andreas B. (te-bachi)


Angehängte Dateien:

Lesenswert?

Hallo

Ich habe von SparkFun ein 9DoF Razor IMU M0 (also ein Atmel SAMD21G18A 
mit 9DoF Sensor und Micro-SD-Slot).
Nun möchte ich zwei I2S Module integrieren:
- [1] Adafruit I2S MEMS Microphone Breakout
      SPH0645LM4H
- [2] Adafruit I2S 3W Class D Amplifier Breakout
      MAX98357A

Dabei soll über das Mikrofon die PCM-Daten in einer WAV-Datei auf die SD 
Karte geschrieben und später diese WAV-Datei auf dem Lautsprecher 
ausgegeben werden (das eine oder das andere, nicht beides gleichzeitig).

Leider hat der SAMD21 nur eine I2S-Schnittstelle. Also soll ein Taster 
am uC zwischen "Aufnehmen" und "Abspielen" wechseln.

So wie ich es verstanden habe, ist der uC immer I2S-Master.
Je nachdem ob der uC als I2S-Master seinen Clock (CLK_I2S_APB) ans 
Mikrofon oder am DAC-Amp liefert, kann entschieden werden, ob man 
"Aufnehmen" oder "Abspielen" möchte.

Dieser Clock kann über zwei externe MOSFET-Paare vom uC angesteuert 
werden:
- Clock an Mikrofon, oder
- Clock an DAC-Amp, oder
- beides aus
(- oder beides ein, was aber nicht sinnvoll ist)
Siehe auch beiliegender Schaltplan. Würde das gehen?
Oder gibt es bessere/andere Lösungen dazu?

Geht das mit den mitgelieferten Arduino Libraries, oder muss ich sie 
gegebenenfalls anpassen?

Hat jemand schon das gleiche oder ein ähnliches Problem schon gelöst?

Andreas



Datenblatt vom Mikrofon (SPH0645LM4H-B):

Active Mode
When Vdd is applied the microphone senses the CLOCK line, if the 
frequency is greater than 900KHz, the microphone enters the normal mode 
of operation. In this mode the I2S Master must provide the CLK and WS 
signals as the microphone is an I2S slave device.

Sleep Mode
When Vdd is applied the microphone senses the CLOCK line, if the 
frequency is less than 900KHz or completely off , the microphone enters 
the sleep mode of operation. In this mode the microphone tri-states the 
DATA pin and turns off internal circuits to reduce power consumption.


Datenblatt vom DAC-Amp (MAX98357A):

Standby Mode
The ICs automatically enter standby mode when BCLK is removed. If BCLK 
stops toggling, the ICs automatically enter standby mode. In standby 
mode, the Class D speaker is turned off and the outputs go into a 
highimpedance state, ensuring that unwanted current is not transferred 
to the load during this condition.

[1] https://www.adafruit.com/products/3421
[2] https://www.adafruit.com/products/3006

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.