Re: [avr-gcc-list] volatile with winavr2010

2010-06-02 Thread Leiu
Thank Joerg Wunsch very much! I've solved my problem! ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

[avr-gcc-list] volatile with winavr2010

2010-06-01 Thread Leiu
Thanks all, But i can't find bug, Here is my full code #include avr/io.h #include avr/interrupt.h #ifndef F_CPU #define F_CPU 800 #endif #include util/delay.h volatile uint8_t first_edge = 'A'; void usart_initiation() { UCSRA = 0; //Control register initiation, double transfer rate

Re: [avr-gcc-list] volatile with winavr2010

2010-06-01 Thread Joerg Wunsch
(Better subscribe to the list, you might miss replies otherwise.) Leiu tvhoa...@gmail.com wrote: Thanks all, But i can't find bug, Here is my full code Result : i can show 'A'! why? Because you're using hyperterm? I've compiled this for an ATmega16, set it up on an STK500, and connected it

Re: [avr-gcc-list] volatile with winavr2010

2010-06-01 Thread Leiu
On Tue, 2010-06-01 at 14:28 +0200, Joerg Wunsch wrote: (Better subscribe to the list, you might miss replies otherwise.) Leiu tvhoa...@gmail.com wrote: Thanks all, But i can't find bug, Here is my full code Result : i can show 'A'! why? Because you're using hyperterm? I've

Re: [avr-gcc-list] Volatile bad compiled while

2009-11-27 Thread max2009tiny
Thanks David but you miss, i write code for tiny2313 with 2048 bytes and without use registers and leave optimize work my code have 3266 bytes +60% then i make noinline for some functions and code reduce to 2666 bytes. Secondary count memory variables in code and max counted replace with register

Re: [avr-gcc-list] Volatile bad compiled while

2009-11-27 Thread Paulo Marques
max2009tiny wrote: Ok thanks i use gcc 4.3.2 secondary question is if i remove volatile from code register unsigned char lastrec asm(r8) then while generate asm efficient but dont work why? a0: 88 11 cpser24, r8 a2: ff cf rjmp.-2 ; 0xa2

Re: [avr-gcc-list] Volatile bad compiled while

2009-11-26 Thread Joerg Wunsch
max2009tiny m...@canor-audio.com wrote: Hi everybody. I make project on Tiny2313 and use volatile register unsigned char lastrec asm(r8) volatile register doesn't work. There used to be a warning for this, which has been dropped in the past. GCC 4.4 does have the warning back:

[avr-gcc-list] Volatile bad compiled while

2009-11-25 Thread max2009tiny
Hi everybody. I make project on Tiny2313 and use volatile register unsigned char lastrec asm(r8) and lastrec is modified on rs232 rx isr. When compile little function __attribute__ ((noinline)) void waitACK(u08 cmack) { while(cmack!=lastrec) ; //wait for reply request } compiler make bad asm

RE: [avr-gcc-list] volatile...

2006-12-16 Thread Larry Barello
gcc-armxxx places volatile data outside the cache... so it must be a compiler dependent feature. Always best to examine the resulting assembly to make sure your assumptions are correct :) | -Original Message- | From: [EMAIL PROTECTED] [mailto:avr-gcc- | [EMAIL PROTECTED] On Behalf Of

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Joerg Wunsch
Javier Almansa Sobrino [EMAIL PROTECTED] wrote: I've noted a non volatile variable is like don't exists (I think). A local variable can often be optimized by the compiler into a register, and it will live there only for the short amount of time when its value is really needed. It might not

Re: [avr-gcc-list] volatile...

2006-12-15 Thread David Brown
[EMAIL PROTECTED] wrote: Hello Javier, Javier Almansa Sobrino wrote: Hi everybody. I've a little stupid question What's the differece between a volatile variable in a funcion and the same variable not volatile? I've noted a non volatile variable is like don't exists (I think).

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Graham Davies
David Brown wrote: You are missing a number of points ... Well, I think we're getting close to complete coverage now! On the subject of volatile isn't enough and straying further from AVR, remember that if your machine has a data cache you need to figure out how to not have the cache between

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Paulo Marques
Graham Davies wrote: David Brown wrote: You are missing a number of points ... Well, I think we're getting close to complete coverage now! Well, since we are going for complete coverage, I'll add my 2 cents, then. Sometimes I don't use volatile at all on the variables, and just use

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Dave Hansen
From: Paulo Marques [EMAIL PROTECTED] Graham Davies wrote: David Brown wrote: You are missing a number of points ... Well, I think we're getting close to complete coverage now! Well, since we are going for complete coverage, I'll add my 2 cents, then. You've opened some new cans of

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Paulo Marques
Dave Hansen wrote: From: Paulo Marques [EMAIL PROTECTED] Graham Davies wrote: David Brown wrote: You are missing a number of points ... Well, I think we're getting close to complete coverage now! Well, since we are going for complete coverage, I'll add my 2 cents, then. You've opened

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Galen Seitz
One more suggestion... If you are using global volatiles shared between an interrupt and mainline code, interrupt handler performance may be improved by moving the volatile into a temporary variable. galen volatile uint16_t counter; SIGNAL(TMR0_OVERFLOW) { uint16_t tmp; tmp =

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Dave Hansen
From: Paulo Marques [EMAIL PROTECTED] Dave Hansen wrote: [...] You've opened some new cans of worms here, but I'll only make one small comment I was afraid of that (the cans of worms, not your comment) ;) Thanks for noticing the implied smiley. Looking at what I wrote, I'm not sure it

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Paulo Marques
Dave Hansen wrote: From: Paulo Marques [EMAIL PROTECTED] [...] But you're actually wrong about the volatile not being needed. Because the sei instruction doesn't claim anything about memory clobbers, without volatile the compiler would be free to re-order instructions and do the sei before

[avr-gcc-list] volatile...

2006-12-14 Thread Javier Almansa Sobrino
Hi everybody. I've a little stupid question What's the differece between a volatile variable in a funcion and the same variable not volatile? I've noted a non volatile variable is like don't exists (I think). Thanks ;) -- Nunca confies en un S.O. del que no tienes código fuente ;-)

Re: [avr-gcc-list] volatile...

2006-12-14 Thread Colin Paul Gloster
On Thu, 14 Dec 2006, Javier Almansa Sobrino wrote: Hi everybody. I've a little stupid question It seems as if you should consult a book about C or not use a language you do not have documentation for. What's the differece between a volatile variable in a funcion and the same variable not

Re: [avr-gcc-list] volatile...

2006-12-14 Thread Henrik Brix Andersen
On Thu, Dec 14, 2006 at 01:16:35PM +0100, Colin Paul Gloster wrote: On Thu, 14 Dec 2006, Javier Almansa Sobrino wrote: Hi everybody. I've a little stupid question It seems as if you should consult a book about C or not use a language you do not have documentation for. No need to get

Re: [avr-gcc-list] volatile...

2006-12-14 Thread Clemens Koller
Hi, Javier! Javier Almansa Sobrino schrieb: Hi everybody. I've a little stupid question Please don't expect soo nice answers for stupid questions in propably not the right mailing-list. ;-) I recommend asking Goole or Wikipedia such questions first because they're really great in

Re: [avr-gcc-list] volatile...

2006-12-14 Thread MWare
Hello Javier, Javier Almansa Sobrino wrote: Hi everybody. I've a little stupid question What's the differece between a volatile variable in a funcion and the same variable not volatile? I've noted a non volatile variable is like don't exists (I think). Despite what some have

RE: [avr-gcc-list] volatile...

2006-12-14 Thread Eric Weddington
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of Larry Barello Sent: Thursday, December 14, 2006 7:43 AM To: [EMAIL PROTECTED]; avr-gcc-list@nongnu.org Subject: RE: [avr-gcc-list] volatile... This is somewhat a compiler issue since

Re: [avr-gcc-list] volatile...

2006-12-14 Thread Graham Davies
[EMAIL PROTECTED] wrote: Despite what some have said about this question, I don't think it is stupid I agree. Although this has been discussed before in this very forum, nobody has so far provided the complete answer this time around. They have just provided the most common example of the use

Re: [avr-gcc-list] Volatile

2005-04-20 Thread Colin Paul Gloster
On Tue, Apr 19, 2005 at 08:53:52PM -0700, stevech wrote: My Two Cents: Operating system functions like atomic access and mutual exclusion and multitasking do *not* belong in a programming language standard. The DoD tried it years ago with Ada and it was a huge failure. Had multitasking in Ada

Re: [avr-gcc-list] 'Volatile'

2005-04-20 Thread Mike Murphree
E. Weddington said: Colin Paul Gloster wrote: On Tue, Apr 19, 2005 at 08:53:52PM -0700, stevech wrote: My Two Cents: Operating system functions like atomic access and mutual exclusion and multitasking do *not* belong in a programming language standard. The DoD tried it years ago with Ada and