I am interested in doing the exact same thing as Derek Malloy did in his video.
I will be making a custom board using the SAM chip as my microcontroller, and I would like to use the Arduino IDE to compile onto the chip. Since the Arduino Due is not a DIP package, and I am not able to just flash and take the chip out of the board, what are my options?
I essentially want to do sometihng like this (link below) with the Due, and not resort to ARMStudio or other ARM IDEs (i really enjoy Arduino IDE).
I was watching the video and see that at around 8:15 into the video the chap replaces the 16MHz crystal with a 20MHz crystal and states that the arduino exactly behaves the same with the 20MHz as with the 16MHz.
Does he mean it continues to run at 16MHz and therefore behaves the same or does he mean it's now running at 20MHz and behaving the same - the delay statements in his blink sketch delaying the same amount of time with the 20MHz as they previously delayed with the 16MHz?
warwound:
I was watching the video and see that at around 8:15 into the video the chap replaces the 16MHz crystal with a 20MHz crystal and states that the arduino exactly behaves the same with the 20MHz as with the 16MHz.
Does he mean it continues to run at 16MHz and therefore behaves the same or does he mean it's now running at 20MHz and behaving the same - the delay statements in his blink sketch delaying the same amount of time with the 20MHz as they previously delayed with the 16MHz?
Martin.
I am just as confused about it before. If the delay is based on a prescale value and the timer, how does the blinking not get effected without a change in software?
Does the 20Mhz crystal run 'underclocked' at 16Mhz...?
I didn't watch the video, but if ALL he did was swap 16 for 20Mhz it had to have had an affect on the speed the program does things.
If only the DUE would have DIP package
If you want ARM + DIP you have to go for an LPC111x (DIP28) or LPC81x (DIP8), these are also available in several SOIC packages that are pretty user friendly.
The SAM3X (as used in the Due) is also available in a 100-pin package that is a lot smaller.
120pin DIP MCU the other day and it was huge!!! Was over 150mm long.
I assume that is a module, not the actual chip itself.
The largest DIP I've seen was the old 68000 processor, at 64 pins that was a monster known as the "aircraft carrier" package.
warwound:
Does he mean it continues to run at 16MHz and therefore behaves the same or does he mean it's now running at 20MHz and behaving the same - the delay statements in his blink sketch delaying the same amount of time with the 20MHz as they previously delayed with the 16MHz?
The chip will run faster because the clock is greater but.... the software based on timers will break. Let me explain. The Arduino core sets up the timers to work with a 16 MHz clock based MCU: if you change the clock but you don't recompile the code for the newer speed, the timings will be wrong, so millis & delay will run faster, and 1000 ms won't be 1 second anymore; the serial could stop working because of the wrong timings etc...
And keep in mind that not all the libraries can adapt themselves to different clock speeds: it's the author that has to implement inside its software a mechanism to check the current clock speed and adapt the library to it, if this is necessary.
warwound:
Does he mean it continues to run at 16MHz and therefore behaves the same or does he mean it's now running at 20MHz and behaving the same - the delay statements in his blink sketch delaying the same amount of time with the 20MHz as they previously delayed with the 16MHz?
The chip will run faster because the clock is greater but.... the software based on timers will break. Let me explain. The Arduino core sets up the timers to work with a 16 MHz clock based MCU: if you change the clock but you don't recompile the code for the newer speed, the timings will be wrong, so millis & delay will run faster, and 1000 ms won't be 1 second anymore; the serial could stop working because of the wrong timings etc...
And keep in mind that not all the libraries can adapt themselves to different clock speeds: it's the author that has to implement inside its software a mechanism to check the current clock speed and adapt the library to it, if this is necessary.
Thanks for the info - i sort of assumed that was the case.
If I develop a custom board with the SAM3X and bring out the RX/TX pins, is it possible to hook up the Arduino Due to these pins and compile code to the SAM3X on the custom board, rather than the chip on the Due? I can probably sacrifice my board and remove destroy the connections that go to the chip on board, or perhaps there is a smart way to bypass it? I understand that if you want to do this with the Uno, you must remove the ATMEGA328 from the board. But since you cannot do that with the Due how can we do this?
Another possible solution would to get an ARM-type external programmer that is compatible with the Arduino IDE and bring out the ICSP pins from the SAM3X. I am not sure if this technique may be used similar to AVR programming.
Any suggestions on how to upload my sketch onto a custom board using the SAM3X would be much appreciated.
is it possible to hook up the Arduino Due to these pins and compile code to the SAM3X on the custom board, rather than the chip on the Due?
I'm not quite following I think. Do you mean pass the Rx/Tx through from the Due to your board?
That might work if you manually erase the SAM first (you have implemented the erase feature with the push button or something I assume).
I can probably sacrifice my board and remove destroy the connections that go to the chip on board,
I don't get this.
Another possible solution would to get an ARM-type external programmer that is compatible with the Arduino IDE and bring out the ICSP pins from the SAM3X.
That's more like it, implement the JTAG/SWD header and buy a cheap programmer.
Another way is to run your Rx/TX to a header and buy a Taigiuino programmer.
is it possible to hook up the Arduino Due to these pins and compile code to the SAM3X on the custom board, rather than the chip on the Due?
I'm not quite following I think. Do you mean pass the Rx/Tx through from the Due to your board?
That might work if you manually erase the SAM first (you have implemented the erase feature with the push button or something I assume).
I can probably sacrifice my board and remove destroy the connections that go to the chip on board,
I don't get this.
The video at the top of the thread shows how to compile your sketch onto an external ATMEGA328 using the Arduino Uno board. He removes the chip from the board, places it on a breadboard and was able to compile the code by passing the Rx/Tx lines from the board to the chip on breadboard.
I would like to do the same with the Arduino Due and the SAM3, but this seems to be troublesome because the chip on the Due is soldered on. My question is how can I program an external SAM3 using the Arduino Due.
If it is possible to somehow by pass the chip on the Arduino Due, and pass the Rx/Tx lines to a bootloaded SAM3 on a custom board, this would be ideal for me.
Another possible solution would to get an ARM-type external programmer that is compatible with the Arduino IDE and bring out the ICSP pins from the SAM3X.
That's more like it, implement the JTAG/SWD header and buy a cheap programmer.
Another way is to run your Rx/TX to a header and buy a Taigiuino programmer.
This would be my preferred method I think.
I will look into this, I have no idea the JTAG header does but from previous research, it looks like this will need to be used to compile code onto the chip
You should also implement the erase function, have a look at their schematics for their Due clone
I'm curious, what was your objection to just using the teensy 3?
Bill, I don't see a difference between the Teensy and the Arduino Due, other than the Teensy has a footprint where you can pop it into a breadboard. The chip is still soldered down and you cannot use this platform to externally program a SAM3 that I want to embed into my custom board.
My goal is to create a board using a SAM3 and use the Arduino IDE to compile my sketch onto it. The Teensy breadboard footprint is good for prototyping, those stages are complete in my project.