uracoli-devel
[Top][All Lists]
Advanced

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

Re: [uracoli-devel] Baud rates


From: Vasilakes, Keith
Subject: Re: [uracoli-devel] Baud rates
Date: Wed, 16 May 2012 10:26:28 -0500

If the purpose of the code is to pull the osc freq down to 7.37, please don't 
call it calibrate!
Call it something like adjust_osc() or SetOscTo737()...

OR, there could be 2 macros, one to calibrate the osc to 8 mhz and another to 
change it to 7.37

Of course theyd be 2 interfaces to the same underlying implementation I'd expect

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Axel Wachtler
Sent: Wednesday, May 16, 2012 12:05 AM
To: address@hidden
Subject: Re: [uracoli-devel] Baud rates

Hallo,

On 15.05.2012 21:13, Joerg Wunsch wrote:
> As Daniel Thiele wrote:
>
>> Probably the internal RC oscillator is calibrated on startup, using
>> CLKM of the transceiver as reference frequency.
>
> The major point here is to calibrate the RC oscillator not to
> 8 MHz but to 7.37 MHz (a "baudrate friendly" frequency).

Looks if we have a motivation for an OSCCAL routine. Here is an initial
idea, maybe we use an inline function in board*.h files that is wrapped
by a macro.

board_xxx.h
=======================================
static inline void calibrate_rc_osc(void)
{
  /* some code that depends on F_CPU */
}

#define CALIBRATE_RC_OSC() calibrate_rc_osc()
=======================================

board.h
=======================================
#ifndef CALIBRATE_RC_OSC
  #define CALIBRATE_RC_OSC()
#endif
=======================================

Axel




reply via email to

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