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

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

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


From: Alan Kilian
Subject: [avr-gcc-list] Re: placing a variable in flash
Date: Mon, 22 Nov 2004 12:39:57 -0600 (CST)

> >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);
  }

  That sets the OSCCAL register in the processor to a value of 16.

  Is that what you are trying to do, or something else?

                         -Alan

-- 
- Alan Kilian <kilian(at)bobodyne.com> 


reply via email to

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