Hello all
Here is an update as to what is going on with this project...
When I connect the RA8875 to the MKR, here are the specifics for communications (that work):
// Connect SCLK to MKR1000 #09 (Hardware SPI clock)
// Connect MISO to MKR1000 #10 (Hardware SPI MISO)
// Connect MOSI to MKR1000 #08 (Hardware SPI MOSI)
#define RA8875_INT 3
#define RA8875_CS 6
#define RA8875_RESET 2
I am able to get my sketch run just fine and have touch screen buttons that are detected when pushed.
Now when I disconnect the RA8875 from the MKR1000 and connect the VS1053 to the MKR1000, here are the specifics for communications (that work):
//#define CLK 13 // SPI Clock, shared with SD card
//#define MISO 12 // Input data, from VS1053/SD card
//#define MOSI 11 // Output data, to VS1053/SD card
// These are the pins used for the breakout example
#define BREAKOUT_RESET 9 // VS1053 reset pin (output)
#define BREAKOUT_CS 7 // VS1053 chip select pin (output)
#define BREAKOUT_DCS 5 // VS1053 Data/command select pin (output)
#define CARDCS 4 // VS1053 CCS - Card chip select pin
#define DREQ 0 // VS1053 DREQ - Data request, ideally an Interrupt pin
As you can see that the only pins that are the same are for the SPI clock, MISO and MOSI.
I get verification that the SD card is read and then it plays the audio files I have on that SD card.
When I connect the VS1053 along with the RA8875 to the MKR1000 and power it on, the TFT does not display the back light on power up, the last sketch executed for the RA8875 does not run and the audio files do not play on the VS1053 and the Serial monitor. I haven't even executed any sketches, just what is in memory on both devices but nothing is running.
My next step is to have the VS1053 be connected to the UNO I have and the RA8875 connected to the MKR1000 and try I2C or TX/RX connections between the two and see if they communicate that way.
I tried I2C recently and the devices were not communicating.
Here are the sketches for both:
MASTER:
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_RA8875.h"
#include <Wire.h>
// I2C Master
int x = 0;
void setup() {
// Start the I2C Bus as Master
Wire.begin();
}
void loop() {
Wire.beginTransmission(9); // transmit to device #9
Wire.write(x); // sends x
Wire.endTransmission(); // stop transmitting
x++; // Increment x
if (x > 5) x = 0; // `reset x once it gets 6
delay(500);
}
-------------------------------------------
SLAVE:
#include <SPI.h>
#include <Adafruit_VS1053.h>
#include <SD.h>
#include <Wire.h>
int LED = 13;
int x = 0;
void setup() {
// Define the LED pin as Output
pinMode (LED, OUTPUT);
// Start the I2C Bus as Slave on address 9
Wire.begin(9);
// Attach a function to trigger when something is received.
Wire.onReceive(receiveEvent);
}
void receiveEvent(int bytes) {
x = Wire.read(); // read one character from the I2C
}
void loop() {
//If value received is 0 blink LED for 200 ms
if (x == '0') {
digitalWrite(LED, HIGH);
delay(200);
digitalWrite(LED, LOW);
delay(200);
}
//If value received is 3 blink LED for 400 ms
if (x == '3') {
digitalWrite(LED, HIGH);
delay(400);
digitalWrite(LED, LOW);
delay(400);
}
}