Go Down

Topic: Changing clock frequency in DUE (Read 442 times) previous topic - next topic

chutki

Nov 07, 2017, 11:54 am Last Edit: Nov 08, 2017, 09:13 am by chutki
Hello al,

I would like to establish an UART communication between DUE and sensor. The sensor I have works at 16mhz and the baud rate is 38400. DUE works at 4mhz , default . I would like to change the DUE to 16mhz. When I looked into datasheet of SAM, there are many clock sources and one of the clock sources is the crstal of 3-20mhz. This can be selected as main clock using the MOSCSEL bit in the Main Oscillator Register (CKGR_MOR) . But thr pre-scaler values cannot make them to 16mhz .Am I right?

Question 2:
How can I access the low level registers ? Just like they have accesed for PWM from this link : https://forum.arduino.cc/index.php?topic=386981.0

Is it possible to write code for arduino due via Atmel Studio 7 ? I want to change the clock frequency of the Arduino DUE and I found no way on the Arduino IDE. IS this possible through Atmel,Studio ?

westfw

Quote
DUE works at 4mhz , default
Due runs at 84MHz by default, so I'm not sure what you're talking about...
(And the Due Serial ports should work fine at 38400 using "SerialX.begin(38400)", with no changes to clocking or low-level USART hacking.
The clock is initialized in .../packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/sam3xa/source/system_sam3xa.c

Quote
How can I access the low level registers ?
The proper definitions are already included; you access them via the CMSIS definitions or by the REG_ definitions.

chutki

Due runs at 84MHz by default, so I'm not sure what you're talking about...
(And the Due Serial ports should work fine at 38400 using "SerialX.begin(38400)", with no changes to clocking or low-level USART hacking.
So ,DUE works at 84mhz and the other device is at 16mhz . And still the UART is possible with same baud rate in UART . Right?

westfw


Go Up