Re: [avr-gcc-list] understanding timers

2006-03-07 Thread Joerg Wunsch
Timothy Smith [EMAIL PROTECTED] wrote:

 that example is fine, i understand what's happening ( i think ) but
 how would i controll the speed of the led blinking? would i use a
 different ISR, such a timer compare?

This example is probably not the best example to learn about timers in
general, as it uses the timer in (phase correct) PWM mode.  For the
classical AVRs (and as the example tries to be as generic as possible,
so it does not go beyond the features of a classical AVR), the
frequency selection options for timers in PWM mode were rather
limited: the IO clock frequency is divided by the prescaler, and then
by either 2 * 256, 2 * 512, or 2 * 1024, for 8, 9, and 10-bit PWM
respectively.

Modern AVRs offer much more options here.  First, there's the choice
between phase correct and fast PWM, and the fixed 8/9/10 bit TOP value
can be replaced by a much more flexible TOP value supplied by ICRx or
OCRxA.  That gives you a much broader range of base frequencies for a
PWM timer, and as the blink frequency in the example is tightly
coupled to the PWM base frequency, would allow you to smoothely change
the blink frequency.

-- 
cheers, Jorg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


[avr-gcc-list] query please help

2006-03-07 Thread rajeev joshi
Hi all,
 I am new to this maling
list .actually I am doing a project on AVR microcontrollers, but i m
surrounded by number of queries,

1. which are the patches necessary for avr-gcc,which version should i use .
2. the patches available on net are compatible to which linux kernel , r they compatible 
 with kernel 2.6 or 2.4.
 
3. The patches are compatible with which linux core ,i have SUSE or i have to install red hat .

4.While working on windows which compiler, simulator shpuld use ,right now i m having codevision AVR ,AVR studio .
5. But i m not gettin how to work on WINAVR .


please provide me your help ,

REGARDS
RAJEEV JOSHI
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


[avr-gcc-list] understanding timers

2006-03-07 Thread Timothy Smith
hello avr people i've been reading and working through various tutorials 
on avr's, and i've managed to to program one and make led's on various 
ports turn on and off, however i'm having a little trouble understanding 
the timer functions.


http://www.nongnu.org/avr-libc/user-manual/group__demo__project.html

that example is fine, i understand what's happening ( i think ) but how 
would i controll the speed of the led blinking? would i use a different 
ISR, such a timer compare?



___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


[avr-gcc-list] multiple -Tdata options passed to the linker for some AVRs

2006-03-07 Thread Joerg Wunsch
See:

http://sourceware.org/bugzilla/show_bug.cgi?id=1272

Suddenly with binutils 2.16, the -Tdata option passed to the
linker ceased to work, while --section-start,.data= remained
functional.

Carlos Lamas analyzed in a thread at avrfreaks.net:

http://www.avrfreaks.net/index.php?name=PNphpBB2file=viewtopicp=208997

that this is due to the way the compiler overrides the generic RAM
location supplied by the linker scripts for all AVRs with extended IO
register space.  In fact, adding -v to the linker command line reveals
the problem:

 /usr/local/lib/gcc/avr/3.4.4/../../../../avr/bin/ld -m avr5 -Tdata 0x800100 -o 
foo.elf /usr/local/lib/gcc/avr/3.4.4/../../../../avr/lib/avr5/crtm128.o 
-L/usr/local/lib/gcc/avr/3.4.4/avr5 -L/usr/local/lib/gcc/avr/3.4.4 
-L/usr/local/lib/gcc/avr/3.4.4/../../../../avr/lib/avr5 
-L/usr/local/lib/gcc/avr/3.4.4/../../../../avr/lib -Tdata=0x8011000 
/var/tmp//ccG96yi3.o -lgcc -lc -lgcc

There are two -Tdata options passed down to the linker.  Obviously,
the order of evaluation has been changed between binutils 2.15 and
2.16, but we can hardly blame them for this.

This is a genuine problem of our current setup.  Carlos claims only
reverting to per-device linker scripts would cure that.  While for
sure, they have some merit (e. g. the linker would be able to flag
overflown sections accurately except for devices that can drive
external RAM), I'm somewhat reluctant to make that step due to the
increasing maintenance overhead.

Are there any other ideas how to circumvent that problem?

Btw., does anyone know why there are five linker scripts per
device/architecture?  (.x, .xbn, .xn, .xr, .xu)
-- 
cheers, Jorg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


Re: [avr-gcc-list] query please help

2006-03-07 Thread Micah Carrick




I don't know about WinAVR, but for linux, I did not need to install any
patches. I justed installed gcc for avr,
libc, and the binutils and I'm up and running fine. This was just a
couple weeks ago using Fedora--which is similar to redhat. My
installation procedure is outlined here:
http://www.micahcarrick.com/v2/content/view/24/27/

- Micah

rajeev joshi wrote:
Hi all,
 I am new to this maling
list .actually I am doing a project on AVR microcontrollers, but i m
surrounded by number of queries,
  
1. which are the patches necessary for avr-gcc,which version should i
use .

2. the patches available on net are compatible to which
linux kernel , r they compatible 
 with kernel 2.6 or 2.4.
 
3. The patches are compatible with which linux core ,i have SUSE or i
have to install red hat 


4.While working on windows which compiler, simulator shpuld use ,right
now i m having codevision AVR ,AVR studio .
5. But i m not gettin how to work on WINAVR .
  
  
please provide me your help ,
  
REGARDS
RAJEEV JOSHI
  

___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
  




___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


RE: [avr-gcc-list] query please help

2006-03-07 Thread Dave Hansen

From: rajeev joshi [EMAIL PROTECTED]
[...]
4.While working on windows which compiler, simulator shpuld use ,right now 
i

m having codevision AVR ,AVR studio .
5. But i m not gettin how to work on WINAVR .


What is your goal?

If you have to get a project out, and you have a paid license for 
CodeVisionAVR, it's probably easiest just to use that.  CVAVR takes you by 
the hand and leads you through the process.  Support on the Yahoo group and 
from HPInfotech is quite good.  It's not necessarily a better tool than 
WinAVR, but its learning curve is easier to overcome, and it's certainly 
better than acceptable.


If your goal is to develop software under WinAVR, and you're not familiar 
with the GNU tools or comfortable with the edit-compile-debug cycle outside 
a completely integrated IDE, you might want to check out avrfreaks.net 
articles on the tools.  Personally, I have a much harder time navigating 
avrfreaks than using the tools, but there is helpful information there if 
you're willing to dig for it.


If you want to develop under both UN*X and Windoze, gcc is a much better 
option.  It is difficult, but possible, to write code that compiles and runs 
under both WinAVR and CVAVR (I've done it many times), but it involves 
becoming quite familiar with both tools, and giving up some of the 
simplifying assumptions of CVAVR, as well as hiding syntax differences 
behind macros.


HTH,
  -=Dave




___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


Re: [avr-gcc-list] query please help

2006-03-07 Thread Derric Tubbs

Amen to the comment below!!! It's the first time I've seen anyone else voice that opinion. I've been running enterprise class UNIX servers, Oracle instances, and writing code in umpteen languages for years yet AVRFreaks still manages to confound me.

Sorry for hijacking the thread.

Tubbs- Original Message From: Dave Hansen [EMAIL PROTECTED]

... articles on the tools.Personally, I have a much harder time navigating avrfreaks than using the tools, but there is helpful information there if you're willing to dig for it. ...___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


Re: [avr-gcc-list] multiple -Tdata options passed to the linker for some AVRs

2006-03-07 Thread Erik Christiansen
On Tue, Mar 07, 2006 at 10:50:42AM +0100, Joerg Wunsch wrote:
 There are two -Tdata options passed down to the linker.  Obviously,
 the order of evaluation has been changed between binutils 2.15 and
 2.16, but we can hardly blame them for this.
 
 This is a genuine problem of our current setup.  Carlos claims only
 reverting to per-device linker scripts would cure that.  While for
 sure, they have some merit (e. g. the linker would be able to flag
 overflown sections accurately except for devices that can drive
 external RAM), I'm somewhat reluctant to make that step due to the
 increasing maintenance overhead.

The maintenance overhead could be eased by INCLUDE-ing common linker
script stuff couldn't it? Conditional assignment of linker variables
would also help with writing more generic scripts. With these aids,
would there be a need for more than the existing per-architecture script
collection? Admittedly, there would be some disruption during
transition.

 Are there any other ideas how to circumvent that problem?

If the linker script were to link .data input sections into a safe new
output section:

.avr_data {
   *(.data)
   ... /* etc. */
}

and 

MEMORY
{
  ...
  avr_data   (rw!x) : ORIGIN = 0x800100, LENGTH = 4K
  ...
}

then the problem would be circumvented, I expect, if the good -T
references this output section. There would then be nothing in the now
unused .data section. (And avr-gcc will never know. :-)

 Btw., does anyone know why there are five linker scripts per
 device/architecture?  (.x, .xbn, .xn, .xr, .xu)

Only what is stated at the head of each one. (I'm afraid I've just
borrowed one, and then rolled my own from there.)

Erik


___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


[avr-gcc-list] __attr_const__ attribute and strlen_P() and friends

2006-03-07 Thread Ned Konz

I'm sure this is a stupid question, but I was wondering...

I noticed that in the avr-libc header pgmspace.h that there are  
declarations including:


extern size_t strlen_P(PGM_P) __ATTR_CONST__; /* program memory can't  
change */
extern size_t strnlen_P(PGM_P, size_t) __ATTR_CONST__; /* program  
memory can't change */


where __ATTR_CONST__ is defined as __attribute__((__const__))

Now, it says in the GCC 4.0 manual about function attributes in the  
section about const that:


--
const
Many functions do not examine any values except their arguments,  
and have no effects except the return value. Basically this is just  
slightly more strict class than the pure attribute below, since  
function is not allowed to read global memory.


Note that a function that has pointer arguments and examines the  
data pointed to must not be declared const. Likewise, a function that  
calls a non-const function usually must not be const. It does not  
make sense for a const function to return void.

--

Of course, strlen_P() *does* have pointer arguments, and *does*  
examine the data pointed to (though only in a read-only way).

Is it a problem that it is declared const, considering the above?

And if I was using the self-programming flash capabilities of the AVR  
would this be a problem?


--
Ned Konz
[EMAIL PROTECTED]




___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list