RE: [avr-gcc-list] Legal registers

2005-06-06 Thread Ben Mann
Out of interest, why not just reserve the register, as per:

http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_regbind

For example


#include avr/io.h
#include avr/signal.h
#include avr/interrupt.h


register unsigned char counter asm(r3);

int main()
{
EICRA |= (1ISC01);
EIMSK |= (1INT0);
sei();
for(;;)
PORTA = counter;

return 0;
}

SIGNAL(SIG_INTERRUPT0)
{
counter++;
}


this example compiles ok, but I strangely believe that the register modifier
is not really intended to be used globally - for example I've not tested if
it actually stops gcc from using r3 in an externally linked file.

Regards,

Ben
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Haase
Bjoern (PT-BEU/EMT) *
Sent: Monday, 6 June 2005 3:26 PM
To: avr-gcc-list@nongnu.org
Subject: AW: [avr-gcc-list] Legal registers

For implementing, e.g. a context switch between two tasks you will have to
safe *all* registers and the stack pointer. There is a distinction between
different uses of the lower and the higher registers concerning the calling
convention (the called function may safely overwrite a certain subset of
registers without saving them), but that does not prevent gcc to take profit
of all of the registers.

Yours,

Björn 

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im
Auftrag von Ron
Gesendet: Sonntag, 5. Juni 2005 10:03
An: avr-gcc-list@nongnu.org
Betreff: [avr-gcc-list] Legal registers

Hi All. Does it somewhere specify that avrgcc and its library routines
should only use a subset of the AVR registers (say 0,1,18-31), or can
the whole 32 be used if required? I ask because it would save a deal of
pushing and popping in a preemptive os if you knew for sure register
subset x would never be used.

Ron Kreymborg



___
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





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


[avr-gcc-list] Legal registers

2005-06-06 Thread Haase Bjoern (PT-BEU/EMT) *
IMO this should work given that 
1.) you mark r3 to be a fixed register by gcc's compile switches 
2.) for all of the externally linked files you have been using these compile 
switches
3.) all other assembler source files follow this convention
.

IMO, it will only be possible to do this with registers r2...r7 . All of the 
other registers are possibly used for specialized purposes like parameter 
passing and may not be marked as fixed without causing problems, IIRC.

Yours,

Björn


-Ursprüngliche Nachricht-
Von: Ben Mann [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 6. Juni 2005 10:11
An: Haase Bjoern (PT-BEU/EMT) *; avr-gcc-list@nongnu.org; 'Ron'
Betreff: RE: [avr-gcc-list] Legal registers

Out of interest, why not just reserve the register, as per:

http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_regbind

For example


#include avr/io.h
#include avr/signal.h
#include avr/interrupt.h


register unsigned char counter asm(r3);

int main()
{
EICRA |= (1ISC01);
EIMSK |= (1INT0);
sei();
for(;;)
PORTA = counter;

return 0;
}

SIGNAL(SIG_INTERRUPT0)
{
counter++;
}


this example compiles ok, but I strangely believe that the register modifier
is not really intended to be used globally - for example I've not tested if
it actually stops gcc from using r3 in an externally linked file.

Regards,

Ben
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Haase
Bjoern (PT-BEU/EMT) *
Sent: Monday, 6 June 2005 3:26 PM
To: avr-gcc-list@nongnu.org
Subject: AW: [avr-gcc-list] Legal registers

For implementing, e.g. a context switch between two tasks you will have to
safe *all* registers and the stack pointer. There is a distinction between
different uses of the lower and the higher registers concerning the calling
convention (the called function may safely overwrite a certain subset of
registers without saving them), but that does not prevent gcc to take profit
of all of the registers.

Yours,

Björn 

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im
Auftrag von Ron
Gesendet: Sonntag, 5. Juni 2005 10:03
An: avr-gcc-list@nongnu.org
Betreff: [avr-gcc-list] Legal registers

Hi All. Does it somewhere specify that avrgcc and its library routines
should only use a subset of the AVR registers (say 0,1,18-31), or can
the whole 32 be used if required? I ask because it would save a deal of
pushing and popping in a preemptive os if you knew for sure register
subset x would never be used.

Ron Kreymborg



___
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





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


Re: [avr-gcc-list] WinAVR- Windows 98 issues

2005-06-06 Thread Royce Sharal Pereira

Hi,

On Fri, 03 Jun 2005 17:07:03 +0530, E. Weddington [EMAIL PROTECTED] wrote:


Royce  Sharal Pereira wrote:


Hi,
I just observed, that while installing winAVR on Win 98 SE, the   
directories are not added to the path, inspite of ticking it in the   
install options. As a result, the compiler or make.exe etc cant be  
found...


This problem is not there with Win XP.

--Royce.


Even after reboot?


Yes, I selected the reboot Now option at the end of the installation.  
And the paths were still not added. I also checked with path command at  
the DOS prompt

Thanks,
--Royce.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


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


[avr-gcc-list] bootloader help

2005-06-06 Thread Parthasaradhi Nayani
Hello all,

Perhaps there is ready documentation on bootloader,
but I have not been able to get what I wanted. How
does one declare a programme to be bootloader program?
that is the code must be loaded in the bootsection
when I program the chip using avrisp. How does one set
the starting address of this code? this is needed as
there are different boot loader program sizes. I want
to laod programme in the boot section which will test
a port bit and jump to  if not low. From  I
want to laod a sample program which may pulse an LED.
How can I do this? Thank you all.

Regards
Nayani P




__ 
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/


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


Re: [avr-gcc-list] WinAVR- Windows 98 issues

2005-06-06 Thread E. Weddington

Royce  Sharal Pereira wrote:


Hi,

On Fri, 03 Jun 2005 17:07:03 +0530, E. Weddington [EMAIL PROTECTED] 
wrote:



Royce  Sharal Pereira wrote:


Hi,
I just observed, that while installing winAVR on Win 98 SE, the   
directories are not added to the path, inspite of ticking it in 
the   install options. As a result, the compiler or make.exe etc 
cant be  found...


This problem is not there with Win XP.

--Royce.


Even after reboot?



Yes, I selected the reboot Now option at the end of the 
installation.  And the paths were still not added. I also checked with 
path command at  the DOS prompt



 And this is with the latest WinAVR release?

Thanks
Eric


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


Re: [avr-gcc-list] WinAVR- Windows 98 issues

2005-06-06 Thread Royce Sharal Pereira

Hi,

On Mon, 06 Jun 2005 20:39:05 +0530, E. Weddington [EMAIL PROTECTED] wrote:


Royce  Sharal Pereira wrote:


Hi,

On Fri, 03 Jun 2005 17:07:03 +0530, E. Weddington [EMAIL PROTECTED]  
wrote:



Royce  Sharal Pereira wrote:


Hi,
I just observed, that while installing winAVR on Win 98 SE, the
directories are not added to the path, inspite of ticking it in the
install options. As a result, the compiler or make.exe etc cant be   
found...


This problem is not there with Win XP.

--Royce.


Even after reboot?



Yes, I selected the reboot Now option at the end of the  
installation.  And the paths were still not added. I also checked with  
path command at  the DOS prompt



 And this is with the latest WinAVR release?


Yes WinAVR-20050214-install.exe. But I'm curious no one else experienced  
this...probably I'm doing something wrong?


Thanks,
--Royce.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


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


[avr-gcc-list] Looking for bootloader

2005-06-06 Thread Michael Giambalvo
Hello,

I have several avr's connected by an RS-485 serial line.  I'm looking
for a bootloader that will work with avrdude and can be compiled under
gcc, and which I can modify to properly handle talking over my bus.

I've found a couple gcc bootloaders so far, but none of them seem to
work with avrdude.

Thanks.


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


Re: [avr-gcc-list] Looking for bootloader

2005-06-06 Thread Neil Davey
Isn't avrdude an isp? Not a bootloader type programmer?  I could be 
totally off the mark.
My suggestion given this type of configuration would be to roll your own 
bootloader code and loader app.
Then you can build the bus controlling logic into the bootloader. (ie 
for selecting which avr to prog)

I'd be suprised if there was code out there.

Regards
Neil Davey


Hello,

I have several avr's connected by an RS-485 serial line.  I'm looking
for a bootloader that will work with avrdude and can be compiled under
gcc, and which I can modify to properly handle talking over my bus.

I've found a couple gcc bootloaders so far, but none of them seem to
work with avrdude.

Thanks.


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

 




--
--
Neil Davey
Griffith University

School of Microelectronic Engineering
Nathan Campus
Phone: 07-3875-7008
Fax: 07-3875-5112

School of Psychology - ACNRC
Mt Gravatt Campus
Phone: 07-3875-3395
--



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


RE: [avr-gcc-list] Looking for bootloader

2005-06-06 Thread Ben Mann
Hi,

I hope you do find one.

I would not automatically expect one to be readily available - RS485 is half
duplex and can feature timing issues in the driver control lines. If the
devices are on a bus you must have a device address packed in with the
programming data - this can be both rather application specific and rule out
common programming software.

Ben

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael
Giambalvo
Sent: Tuesday, 7 June 2005 9:02 AM
To: Neil Davey
Cc: AVR-GCC-list@nongnu.org
Subject: Re: [avr-gcc-list] Looking for bootloader

Sorry, I should have been more explicit.

I'm running on a short time frame, so I don't really have time to
write a bootloader and the programmer app for it.

My application can handle the bus logic, then reset into the
bootloader when the bus is cleared for programming.  The modification
I would need to make to the bootloader's code amounts to setting a pin
high before each transmit and low when the transmit is complete - a
very simple modification, I just need the source so I can do it.

As I said, I don't have time to develop the programming app, and using
avrstudio isn't an option.  I'm hoping for a bootloader that supports
the stk500, avr910, or somesuch protocol like that, and could be used
directly with avrdude (or uisp for that matter)

I'd be really surprised if such a project didn't exist.  I've found a
couple of bootloaders already that work with avrstudio.  Anyone have
any good leads?  Is there an open source port of the butterfly
bootloader to gcc?  I believe that works with avrdude.

On 6/6/05, Neil Davey [EMAIL PROTECTED] wrote:
 Isn't avrdude an isp? Not a bootloader type programmer?  I could be
 totally off the mark.
 My suggestion given this type of configuration would be to roll your own
 bootloader code and loader app.
 Then you can build the bus controlling logic into the bootloader. (ie
 for selecting which avr to prog)
 I'd be suprised if there was code out there.
 
 Regards
 Neil Davey
 
 Hello,
 
 I have several avr's connected by an RS-485 serial line.  I'm looking
 for a bootloader that will work with avrdude and can be compiled under
 gcc, and which I can modify to properly handle talking over my bus.
 
 I've found a couple gcc bootloaders so far, but none of them seem to
 work with avrdude.
 
 Thanks.
 
 
 ___
 AVR-GCC-list mailing list
 AVR-GCC-list@nongnu.org
 http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
 
 
 
 
 
 --
 --
 Neil Davey
 Griffith University
 
 School of Microelectronic Engineering
 Nathan Campus
 Phone: 07-3875-7008
 Fax: 07-3875-5112
 
 School of Psychology - ACNRC
 Mt Gravatt Campus
 Phone: 07-3875-3395
 --
 



___
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


[avr-gcc-list] Array element in inline assembly

2005-06-06 Thread Matt McLellan
Could someone help me out, I want to use the load an
array element into a register.  When I do this:

asm(lds r16, array+n::);

Where n is the array element I want, it works fine. 
But what I want to do it this:

asm(lds r16, array[element]::);

That gives me the following error:

Error: garbage at end of file

I've also tried passing it as an arguement, but can't
seem to figure out what constraint to use:

asm(lds r16, %0: =x (array[element]):);

I've tried every constraint for x in the manual, but
none of them seem to work.  Is there a newer version
of the inline assembly manual that I haven't found? 
The one I'm using is:
http://www.nongnu.org/avr-libc/user-manual/inline_asm.html

Any help would be appreciated.

Thanks


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


Re: [avr-gcc-list] Array element in inline assembly

2005-06-06 Thread Joerg Wunsch

Matt McLellan [EMAIL PROTECTED] wrote:

 asm(lds r16, array[element]::);
 
 That gives me the following error:
 
 Error: garbage at end of file

Sure, assembler is not C. ;-)

You'd need to compute the address yourself in assembler.

 I've also tried passing it as an arguement, but can't
 seem to figure out what constraint to use:
 
 asm(lds r16, %0: =x (array[element]):);

lds is probably the wrong operation to try.  If you want
the compiler to do the address calculation on your behalf,
rather let it pass you the fetched value in a register.

p.s.: This is supposed to be a closed list, so without a
subscription, you risk missing answers.
-- 
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