Go Down

Topic: start sound module with serial interface of Arduino Micro (Read 938 times) previous topic - next topic

kretberl


I want to start a sound-module (http://www.voicemodul.de/M22P.pdf) with the Arduino Micro over the  serial interface (Pin 20 pin 21) . I tried it with the following code, but without success.

#include <SoftwareSerial.h>
#define rxPin 0
#define txPin 1
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);
//SoftwareSerial mySerial(0, 1);

// sound-bytes (sound-module M22P) without checksum:
byte sound01[] = {0x7E, 0xFF, 0x06, 0x0F, 0x00, 0x01, 0x01, 0xEF};
byte sound02[] = {0x7E, 0xFF, 0x06, 0x0F, 0x00, 0x02, 0x01, 0xEF};
byte sound04[] = {0x7E, 0xFF, 0x06, 0x0F, 0x00, 0x04, 0x01, 0xEF};
byte sound06[] = {0x7E, 0xFF, 0x06, 0x0F, 0x00, 0x06, 0x01, 0xEF};

void setup() {
// initialialize pins:

  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);

// initialialize serial interface:
  mySerial.begin(9600);
}
void loop() {
    mySerial.write(sound01, sizeof(sound01));
    delay(10000);
    mySerial.write(sound02, sizeof(sound02));
    delay(10000);
    }     

Where is the mistake?

Grumpy_Mike

Quote
Where is the mistake?
Using software serial on the hardware serial pins for a start.

Quote
over the  serial interface (Pin 20 pin 21)
What pins are these? Not Arduino pins.

kretberl


Grumpy_Mike

Quote
over the  serial interface (Pin 20 pin 21) .
But these are audio outputs
Quote
20 DAC_R Audio output right channel Drive external earphone or amplifier

21 DAC_L Audio output left channel Drive external earphone or amplifier
You need to use the module pins
Quote
4 TX UART serial output

5 RX UART serial input

Go Up