I am playing with my own developed board, based on the Arduino Zero schematic, I tried to make it as similar as the Arduino Zero, searching for the highest compatibility with the Arduino Libraries, except that there is no EDBG Debugger.
The SAMD21 MCU is coming directly from Atmel, that means has not been configured yet, no FUSE bits, no bootloader, etc.
I connected my board using an ATMEL ICE programmer in the SWD pins, flashed succesfully the Arduino bootloader and started downloading my first programs playing with Digital I/O successfully.
I am trying now to test all the hardware piece by piece (Digital I/O, Analog I/O, Communications Serial, etc), using small sketches that I can easily debug. I have still not jumped into the Atmel Studio, because I feel myself very comfortable using the Arduino IDE.
I am having two kind of problems so far:
- first, the board does not boot automatically, I have to unplug-plug the power supply, and it still doesn´t boot, it seems that I have to RESET some pin, it takes me an effort to start the board playing with some pins, I don´t know still the combination that boots the program.
- Second issue is regarding the native USB, I can not see it altogether. I plug an USB cable but I can´t see it in my Linux computer (lsusb command), and the program itself does not go further than the SETUP. It can be a hardware issue, or some missed configuration in the MCU itself
Can you give any idea or advice?.
This is the program I am using to check USB activity:
const int ledPin = 9; // number of the LED pin
const int speakerPin = 8; // bumber of Buzzer Pin
const int DIPin = 5; // bumber of Digital Input Pin <- Entrada Digital a chequear!!
int ledState = LOW; // ledState used to set the LED
unsigned long previousMillis = 0; // will store last time LED was updated
const long interval = 2000; // interval at which to blink (milliseconds)
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(speakerPin, OUTPUT);
pinMode(DIPin, INPUT);
} ///// FIN DE SETUP /////
void loop() {
// BEEP CADA 5 SG PARA ENTERARME POGRAMA ACTIVO ---------------------------------------
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
// Make a Beep in each transition
for (int i=0; i<500; i++) { // generate a 1KHz tone for 1/2 second
digitalWrite(speakerPin, HIGH);
delayMicroseconds(50);
digitalWrite(speakerPin, LOW);
delayMicroseconds(50);
}
}
// COMPROBACION ENTRADAS DIGITALES ---------------------------------------
bool DI;
DI = digitalRead(DIPin);
if (DI) {
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
digitalWrite(ledPin, ledState);
}
} ///// FIN DE LOOP /////