Cannot get basic sketch working

Post Reply
rickyelqasem
Posts: 14
Joined: Fri May 18, 2018 1:20 pm

Cannot get basic sketch working

Post by rickyelqasem » Sun Jan 19, 2020 6:11 pm

I've looped back around to looking at these boards again. I have 2 and I cannot get them to run a simple sketch.

void setup() {
SerialUSB.begin(9600);
SerialUSB.print("I can start the serial");

}

void loop() {
// put your main code here, to run repeatedly:

}

Nothing is outputted to the serial monitor.

Also when I send a sketch I get this weird thing where it changes com port several times through the upload process. It happens on multiple machines. At first I thought I had a dodgy board but then I open the 2nd of my NANO-ARMs for the first time and the same thing happens. Anything obvious?

rickyelqasem
Posts: 14
Joined: Fri May 18, 2018 1:20 pm

Re: Cannot get basic sketch working

Post by rickyelqasem » Sun Jan 19, 2020 7:08 pm

My bad.. I forgot to wait for the serial..

Still need to fix this com ports jumping everywhere.

Bertus Kruger
Site Admin
Posts: 1669
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: Cannot get basic sketch working

Post by Bertus Kruger » Wed Jan 22, 2020 6:33 pm

rickyelqasem wrote:
Sun Jan 19, 2020 7:08 pm
Still need to fix this com ports jumping everywhere.
This is because its a software serial.

When uploading firmware to the board it listens to particular boadrate and only exposes a normal serial port when SerialUSB.begin is run.

This is the same behavior as Arduino Zero's do.

rickyelqasem
Posts: 14
Joined: Fri May 18, 2018 1:20 pm

Re: Cannot get basic sketch working

Post by rickyelqasem » Sat Jan 25, 2020 10:27 am

Do you know away of attaching a usb ftdichip module to DO/D1 so I can communicate/send sketch using normal serial? I've tried doing it as the board was a Arduino mini but I just cannot get it to upload a sketch.

Bertus Kruger
Site Admin
Posts: 1669
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: Cannot get basic sketch working

Post by Bertus Kruger » Mon Jan 27, 2020 6:41 pm

rickyelqasem wrote:
Sat Jan 25, 2020 10:27 am
Do you know away of attaching a usb ftdichip module to DO/D1 so I can communicate/send sketch using normal serial? I've tried doing it as the board was a Arduino mini but I just cannot get it to upload a sketch.
ARM chips are not hardwired with serial ports and can not be programmed like an Arduino UNO. The Zero boot loader works different..
More details : https://www.arduino.cc/en/Guide/ArduinoZero#toc10

Are you picking native Arduino Zero (Native USB Port) as the board type?

To use the serial monitor, and see what your sketch does from the beginning, you'll need to add few lines of code inside the setup(). This will ensure the SAMD21 will wait for the SerialUSB port to open before executing the sketch:

while (!SerialUSB) ;

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest