Skip to content

XMega timer problem #4281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 191 commits into from
Closed

XMega timer problem #4281

wants to merge 191 commits into from

Conversation

KHeintz
Copy link

@KHeintz KHeintz commented Dec 9, 2015

I think this solve the RTC timer problem.
I use this changes in wiring.c

define CLK_RTCSRC_RCOSC32_gc (0x06<<1)// Set the internal 32.768kHZ oscillator as clock source for RTC.

ifdef USE_RTC

/* Turn on internal 32kHz. */
OSC.CTRL |= OSC_RC32KEN_bm; //cal RC Oscillator

do {
/* Wait for the 32kHz oscillator to stabilize. */
} while ( ( OSC.STATUS & OSC_RC32KRDY_bm ) == 0);

/* Set internal 32.768kHZ oscillator as clock source for RTC. */
CLK.RTCCTRL = CLK_RTCSRC_RCOSC32_gc | CLK_RTCEN_bm;//32.768kHZ RC RTC clock

if defined(USE_RTC)

do {
/* Wait until RTC is not busy. */
} while ( RTC.STATUS & RTC_SYNCBUSY_bm );

/* Configure RTC period to 1 millisecond. */
RTC.PER = 129;//1ms
RTC.CNT = 0;
RTC.COMP = 129;
RTC.CTRL = ( RTC.CTRL & ~RTC_PRESCALER_gm ) | RTC_PRESCALER_DIV1_gc;

…Code to github and updated to 0022 release, with the blessing from GorillaCoder.
…ated avrdude (5.11) from the original package
…e it possible to use non-sequencial portmapping work with external interupts.
commit d9f9676
Author: David A. Mellis <[email protected]>
Date:   Tue Oct 25 11:15:14 2011 -0400

    Bug fix in replace().

    http://code.google.com/p/arduino/issues/detail?id=694
commit 18838fb
Author: David A. Mellis <[email protected]>
Date:   Mon Oct 24 16:45:44 2011 -0400

    Renaming LED to LED_BUILTIN.

    http://code.google.com/p/arduino/issues/detail?id=651
Federico Fissore and others added 26 commits April 17, 2014 12:44
…8.1' into xmegaduino-with-avr-toolchain-gcc-4.8.1
noticed that sometimes delays were necessary to have serial "work" in some applications. this made them unnecessary
improved performance of HardwareSerial
This makes Xmegaduino use DTR signal when programming and correctly reset Akafuino. (Only really needed on Windows)
…), to allow for multiple SPI ports and remove hard-coded values for MISO/MOSI/SCK etc.

See SPI.h for details and usage.
…ers for dynamic usage (SPSR,SPDR,SPCR now work in 3rd party libs, when using dynamic port settings), refinements to naming conventions and additional documentation.

Pat Deegan, Nov 4 2014.
Changed SPISettings name to SPIPortSettings
@matthijskooijman
Copy link
Collaborator

I suspect this pullrequest was intended to be submitted to XMegaDuino? I don't think it looks relevant to normal Arduino, and at the least the PR is way too big. I'm closing it, feel free to comment if I understood things wrong.

@ffissore ffissore modified the milestone: Release 1.6.7 Dec 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants