atmega256rfr2 MAC counts on 62.5kHz instead of 32768Hz

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using atmega256rfr2  chip - (LwMesh)

I would like to use MAC symbol counter only as a RTC clock - always clocked by 32kHz external clock - but my chip seems to be clocked always with 62.5kHz

 

Any ideas ?

 

I am using this code:

  /*
   * Enable Symbol Counter and back-off slot counter
   */
  macsc_enable();
  macsc_write_clock_source(MACSC_32KHz);
  macsc_sleep_clk_enable();

 

 

 

additionaly I fixed function:

/**
 * \brief Configure MAC Symbol Counter Clock Source
 *
 * \param macsc macsc clk src
 */
static inline void macsc_write_clock_source(enum macsc_xtal source)
{
    if (source == MACSC_16MHz)
    {
      SCCR0 &= ~(1 << SCCKSEL);
//        SCCR0 |= (source << SCCKSEL);
    }
    else if (source == MACSC_32KHz)
    {
      SCCR0 |= (1 << SCCKSEL);
//        SCCR0 &= ~(1 << SCCKSEL);
    }
}

 

Last Edited: Fri. Oct 16, 2015 - 12:48 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it possible that 32kHz clock doubles it frequency ?

I am using dresden elektronik module: deRFmega256-23M10

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does anybody run MAC timer at 32768Hz RTC timer in operation ?