avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] Using 32.768Khz crystal for timer 2


From: Neil Davey
Subject: Re: [avr-chat] Using 32.768Khz crystal for timer 2
Date: Wed, 16 Apr 2008 19:55:21 +1000
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

Hi Ori,
Ok, so you need to connect the 32kHz crystal to the TOSC1 and TOSC2 pins, not the XTAL pins..

Regards
Neil Davey

address@hidden wrote:
Thank you for your answer,

I have enabled global interrupt flag (I did get interrupts from the serial port)
I would like to use the crystal only for the timer.
the CPU itself is running on the internal oscillator (default).

--
Ori Idan


On Wed, Apr 16, 2008 at 10:43 AM, Neil Davey <address@hidden <mailto:address@hidden>> wrote:

    Hi Ori,


    address@hidden
    <mailto:address@hidden> wrote:

        I have a simple system with 32.768Khz crystal connected to
        XTAL1 and XTAL2
        Do I need a special operation to enable it?

        I did the following initializations in order to get a 1sec
        interrupt:

           TCCR2B = 0x05;            /* Osc/128 prescaler */
           ASSR = _BV(AS2);

    Doesn't this attach the timer clock to TOSC pin(s)?

           TIMSK2 = _BV(TOIE2);    /* enable overflow interrupt */

        However no interrupt was generated.
        What did I do wrong?

    Are you setting the global interrupt flag? sei()


-- Ori Idan

    Are you wanting to run the whole micro from the 32K crystal, or
    just the timer?

    Regards
    Neil Davey



    _______________________________________________
    AVR-chat mailing list
    address@hidden <mailto:address@hidden>
    http://lists.nongnu.org/mailman/listinfo/avr-chat




--
ספרים וסיפורים שכתבתי: http://www.thestories.org


--
--------------------------------------
Neil Davey
Griffith University

Centre for Wireless Monitoring and Applications
Griffith School of Engineering
Nathan Campus
Phone: 07-3735-7008
Fax: 07-3735-5112

School of Psychology - ACNRC
Mt Gravatt Campus
Phone: 07-3735-3395
--------------------------------------






reply via email to

[Prev in Thread] Current Thread [Next in Thread]