Hello,
I am having trouble implementing a simple hardware Serial connection between the Daisy Seed and an Arduino Nano. I am programming the Seed with DaisyDuino.
I have confirmed that the Arduino is properly writing data by connecting another Nano as the receiver. This works fine.
However, when the Nano is transmitting to the Seed, the Seed never sees any data available.
Here is the simplified DS code I’m using to test:
#include "DaisyDuino.h"
DaisyHardware hw;
HardwareSerial hwSerial(15, 14);
void AudioCallback(float **in, float **out, size_t size) {
for (size_t i = 0; i < size; i++) {
out[0][i] = out[1][i] = 0.0;
}
}
void setup() {
Serial.begin(9600);
hwSerial.begin(115200);
hw = DAISY.init(DAISY_SEED, AUDIO_SR_48K);
float sample_rate = DAISY.get_samplerate();
DAISY.begin(AudioCallback);
}
void loop() {
if (hwSerial.available() > 0) {
int nfcData = hwSerial.read();
Serial.println(nfcData);
}
}
Here is the Arduino Nano Test code, which writes Serial data when a PN532 module detects an NFC card. This code is confirmed working when transmitting to another Nano.
#include <Adafruit_PN532.h>
#define PN532_IRQ (2)
#define PN532_RESET (3) // Not connected by default on the NFC Shield
Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);
unsigned long lastNfcCheckTime = 0;
int nfcCheckInterval = 1500;
void setup() {
Serial.begin(115200);
while (!nfc.begin()) {
delay(10);
}
pinMode(13, OUTPUT);
}
void loop() {
if (millis() > lastNfcCheckTime + nfcCheckInterval) {
lastNfcCheckTime = millis();
checkNFC();
}
}
void checkNFC() {
uint8_t success;
uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; // Buffer to store the returned UID
uint8_t uidLength; // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, &uidLength, 100);
if (success) {
if (uidLength == 4) {
uint8_t keya[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
success = nfc.mifareclassic_AuthenticateBlock(uid, uidLength, 4, 0, keya);
if (success) {
uint8_t data[16];
success = nfc.mifareclassic_ReadDataBlock(4, data);
if (success) {
Serial.write(data[0]);
digitalWrite(13, LOW);
delay(50);
digitalWrite(13, HIGH);
}
}
}
}
}
Here is a picture of my wiring. On the DS I’m using pin 15 for Rx and 14 for Tx.
Hopefully I’m missing something obvious. Any help is much appreciated. Thanks in advance!
