avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Re: placing a variable in flash


From: E. Weddington
Subject: Re: [avr-gcc-list] Re: placing a variable in flash
Date: Mon, 22 Nov 2004 11:49:54 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Alan Kilian wrote:

Say I place the Oscillator Calib. byte at 0x1fff. How can retreive it in my
program? I have to 'tell' GCC to look for it at (byte)location 0x1fff; which
means I need to have a variable(or const) located at 0x1fff.


 Are you trying to set the oscillator calibration register to some
 value you determined at compile time?

 If so, how about this code?

 #define CALIBRATION 0x10    // For example

 #include <avr/io.h>

 main () {
     outb(OSCCAL, CALIBRATION);
 }


Don't use the outb, inb, outp, inp macros. They are all deprecated. Use direct access, such as:

OSCCAL = CALIBRATION;


reply via email to

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