Go Down

Topic: Selfmade Due running way to slow (Read 1 time) previous topic - next topic

tsaG

Hi!

I build my own Due Board (kind of). I programmed it using an J-Link (SWD). My first try was uploading the Blink sketch. When trying to Blink with Output Digital 50, it way to slow! When I set the Sketch to have an Intervall of 1 sec, the Due actually takes 6 sec to do it!

I uploaded the sketch (as I said) using my Segger J-Link and AtmelStudio with the Arduino DUE Project file selected. What could that be? are there any fuses I need to set?

fungus

#1
May 09, 2013, 06:56 pm Last Edit: May 09, 2013, 08:16 pm by fungus Reason: 1

Hi!

I build my own Due Board (kind of). I programmed it using an J-Link (SWD). My first try was uploading the Blink sketch. When trying to Blink with Output Digital 50, it way to slow! When I set the Sketch to have an Intervall of 1 sec, the Due actually takes 6 sec to do it!


You probably didn't set the proper CPU clock speed.


are there any fuses I need to set?


Yes.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

john1993

for optiboot with 8mhz internal clk i found h=d6 l=e2 best. for 16mhz crystal i use h=d6 l=a7. these preserve ee on download as opposed to arduino settings which, for some peculiar reason, destroy the ee data every time.

tsaG

Hi,

thanks for the fast response. Im using an 12mhz and 32.xxkhz Crystal. The Sam3x8e doesnt use Optiboot.
Also, I cant find the Fuse settings, the only bits I can set are the GPNVM and Lockbits.
Where do I have to look? Do I need any other external tools?

fungus


Hi,

thanks for the fast response. Im using an 12mhz and 32.xxkhz Crystal. The Sam3x8e doesnt use Optiboot.
Also, I cant find the Fuse settings, the only bits I can set are the GPNVM and Lockbits.
Where do I have to look? Do I need any other external tools?


For weird crystals you might have to edit "boards.txt" and create a new entry for your board/crystal (set F_CPU).
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

tsaG

But the Due also uses an 12mhz fast and 32.768 Slow Crystal  :(
http://arduino.cc/en/uploads/Main/arduino-Due-schematic.pdf

tsaG

Sorry for doupleposting, but could anyone look on their Due to tell me which Crystal is installed? I read several Threads where it says there is an 16mhz Crystal, which would explain the whole thing here.

stimmer

The SAM3X crystal is 12MHz. It doesn't have fuses, instead the clock speed is set by the PLL registers. To get 84MHz you set some register somewhere to multiply the crystal frequency by 7. I don't know any more about it than that though.
Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html

westfw

Do you call Atmel's SystemInit() function from your main() ?
This is called from the Arduino main.c, and appears to setup default system clock behavior.
Normally, I would think that code should call sysclk_init() from the asf library (at least, if you're using asf (which arduino does)), but I don't see that in the arduino startup.
The actual code is in ...hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam3xa/source/system_sam3xa.c

baselsw


Sorry for doupleposting, but could anyone look on their Due to tell me which Crystal is installed? I read several Threads where it says there is an 16mhz Crystal, which would explain the whole thing here.


Hmm, I've built a Due barebones some time ago.. And the blink sketch is working AÒK!! Here is the thread: http://forum.arduino.cc/index.php?topic=152234.0.. I used 12MHz and  32.768kHz crystals...

Hullo tsag . I have been trying to connect board work to the J-Link Segger ......... it detects the board but it does nt do anything else , it says failed to read or write ... and it detects wrong core ID ...... so can u plz tell me how u made it work? .... (I have J-Flash V 4.5 as the software for the J link )

Go Up