Re: [avr-gcc-list] output current for ATMega128 on output pins
Torsten, AVR data sheets talk about 25 mA current per pin., but there is some limitation on the total current drawn. If you are planing to drive some LEDs (4/5) I think you can drive them directly from the port pins. You may consider sinking current to switch the LED ON rather than on sourcing current. Regards Nayani P --- Torsten Mohr <[EMAIL PROTECTED]> wrote: > Hi, > > how much current i can output on a > port. > > I'd like to drive some LEDs. __ Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
RE: [avr-gcc-list] why does this not work?!?
I added avr-objdump -h -S qwe.ELF > qwe.LST to the build sequence, and the LST shows too few jump vectors. Adding -mmcu=atmega128 to the linker - 2nd avr-gcc line - seems to fix this. Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Torsten Mohr Sent: Wednesday, 8 June 2005 8:11 AM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] why does this not work?!? Hi, i use binutils-2.15, gcc-3.4.4 and avr-libc-1.2.3 I tracked down a certain problem to the attached example code. There are two switches on PB2 and PB3 and there are two LEDs on PB4 and PB5. Sometimes the code after the simple for() is reached (what i expect, "it works"), sometimes not. I see this on the patterns the LEDs show. - If i use "i" as a global variable, the for() does not seem to exit. - If i use "i" as the local variable, defined in main() it works. - If i use "i" as a global variable and set the limit in the for() from 2 to 1 it works. That way the exit condition for for() is met immediately. This must be some really stupid bug i wrote, but i don't see it at the moment. It would be great if anybody could give me some hints on this one. Best regards, Torsten. I compile with these commands: avr-gcc -I /opt/avr/avr/include/avr -mmcu=atmega128 -Wa,-ahnls=qwe.s -c \ qwe.c -O0 -oqwe.o avr-gcc -I /opt/avr/avr/include/avr -o qwe.elf qwe.o avr-objcopy -O srec qwe.elf qwe.hex --- example code: #include #include #include #define L1 0x10 #define TMASK 0x0c #define LMASK 0x30 volatile unsigned int i; int main(void) { //volatile unsigned int i; cli(); wdt_disable(); DDRB = LMASK; PORTB = TMASK | L1; for(i = 0; i < 2; i++); PORTB = TMASK | LMASK; do { i++; } while(1); return 0; } ___ 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] why does this not work?!?
Hi, i use binutils-2.15, gcc-3.4.4 and avr-libc-1.2.3 I tracked down a certain problem to the attached example code. There are two switches on PB2 and PB3 and there are two LEDs on PB4 and PB5. Sometimes the code after the simple for() is reached (what i expect, "it works"), sometimes not. I see this on the patterns the LEDs show. - If i use "i" as a global variable, the for() does not seem to exit. - If i use "i" as the local variable, defined in main() it works. - If i use "i" as a global variable and set the limit in the for() from 2 to 1 it works. That way the exit condition for for() is met immediately. This must be some really stupid bug i wrote, but i don't see it at the moment. It would be great if anybody could give me some hints on this one. Best regards, Torsten. I compile with these commands: avr-gcc -I /opt/avr/avr/include/avr -mmcu=atmega128 -Wa,-ahnls=qwe.s -c \ qwe.c -O0 -oqwe.o avr-gcc -I /opt/avr/avr/include/avr -o qwe.elf qwe.o avr-objcopy -O srec qwe.elf qwe.hex --- example code: #include #include #include #define L1 0x10 #define TMASK 0x0c #define LMASK 0x30 volatile unsigned int i; int main(void) { //volatile unsigned int i; cli(); wdt_disable(); DDRB = LMASK; PORTB = TMASK | L1; for(i = 0; i < 2; i++); PORTB = TMASK | LMASK; do { i++; } while(1); return 0; } ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
Re: [avr-gcc-list] output current for ATMega128 on output pins
Torsten Mohr <[EMAIL PROTECTED]> wrote: > I'd like to drive some LEDs. In addition to the other comments, also have a look at the diagrams. For driving a LED, you don't have to care about maintaining the correct logic levels, but you have to care about the allowed total power dissipation. Note that at Vcc=5V, the ATmega128 is one of the few AVRs where you will exceed the allowed per-pin current when connecting a LED directly against GND without a resistor. For most other AVRs, this is still within the specs (and even for the ATmega128L at Vcc=3V). -- cheers, J"org .-.-. --... ...-- -.. . 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] output current for ATMega128 on output pins
Torsten Mohr <[EMAIL PROTECTED]> wrote: > Hi, > > i just browsed the data sheet but could not find in the "electrical > characteristics" how much current i can output on a port. > > I'd like to drive some LEDs. > > I wonder, but this value should be in the data sheet, i must have > missed it. > The spec you are looking for is VOL, or Output Low Voltage. This shows maximum output low voltage while sinking the given current. For a 3.3V supply the mega128 can sink 10 mA while the voltage at the pin is 0.5V or less. This is on page 321. Be sure to read the footnotes too. They spell out some restrictions on the total current allowed. galen ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
Re: [avr-gcc-list] output current for ATMega128 on output pins
> i just browsed the data sheet but could not find in the "electrical > characteristics" how much current i can output on a port. > > I'd like to drive some LEDs. > > I wonder, but this value should be in the data sheet, i must have > missed it. On the Mega-128 data sheet I read there are two values I found: Maximum current per I/O pin 40.0 mA Maximum current Vcc and GND 200.0 mA So, don't try and drive 10 LEDs at 20.0 mA each. -Alan -- - Alan Kilian ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
[avr-gcc-list] output current for ATMega128 on output pins
Hi, i just browsed the data sheet but could not find in the "electrical characteristics" how much current i can output on a port. I'd like to drive some LEDs. I wonder, but this value should be in the data sheet, i must have missed it. Best regards, Torsten. ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
Re: [avr-gcc-list] Gcc error message format
"Colin Paul Gloster" <[EMAIL PROTECTED]> wrote: > sed "s/\([0-9]*\)\(: error: \)/(\1) \2/g" But don't forget that you gotta catch stderr, not stdout. -- cheers, J"org .-.-. --... ...-- -.. . 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] Looking for bootloader
I have a collection of about 10 bootloaders that I've accumulated - mostly from the Academy section of AVRfreaks.net. There is but one in this set which is small/tight ASM code for small memory chips like the mega8. All others are in various dialects of C. I can send or post if you wish. - Original Message - From: "Zane D. Purvis" <[EMAIL PROTECTED]> Date: Tuesday, June 7, 2005 9:11 am Subject: Re: [avr-gcc-list] Looking for bootloader > > > Is there an open source port of the butterfly > >bootloader to gcc? I believe that works with avrdude. > > > > > > Martin Thomas has a version of the AVR Butterfly bootloader ported > to > gcc available here: http://www.siwawi.arubi.uni- > kl.de/avr_projects/#bf_boot > In fact, he has a couple of bootloaders available on that page. > > > > > ___ > 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] Looking for bootloader
Is there an open source port of the butterfly bootloader to gcc? I believe that works with avrdude. Martin Thomas has a version of the AVR Butterfly bootloader ported to gcc available here: http://www.siwawi.arubi.uni-kl.de/avr_projects/#bf_boot In fact, he has a couple of bootloaders available on that page. ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
RE: [avr-gcc-list] Gcc error message format
sed "s/\([0-9]*\)\(: error: \)/(\1) \2/g" ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
Re: [avr-gcc-list] Gcc error message format
Ron wrote: I just realised the other day that I can use MS Visual Studio as the complete IDE for my AVR projects. And IntelliSense is very handy. Easy enough to add the path, but can anyone suggest how to enclose the line number in brackets? It's not very handy if it's not flexible enough to do it on it's own, is it? ;-) The only way, then, is with a post processing script, I suppose... Eric ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
RE: [avr-gcc-list] Gcc error message format
I have not thought about using visual studio but that is great! I know I use www.wholetomato.com product called visual assist (VA). I curse when I do embedded development and do not have the use of VA. For those who want to know VA is an add-in for Visual Studio it makes the code editor work with you not against you. For example if you type a variable's name wrong it will underline it in red like M$ Word does for misspellings. It will also adds other features like automatic completes, etc. Personally I have been trying to find a stand alone editor for embedded development which does this stuff, the closest I have found is Code Wright. Regards, Trampas -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ron Sent: Tuesday, June 07, 2005 6:54 AM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] Gcc error message format I just realised the other day that I can use MS Visual Studio as the complete IDE for my AVR projects. And IntelliSense is very handy. Only trouble is getting auto-error location working (ie you click on the error message and the IDE takes you to that line in that source file). VS requires the error line to specify the complete path to the source file and have the error line number in brackets, eg D:\AVR\Project1\Main.c(123) : error... Whereas gcc presents an error as: Main.c:123: error... Easy enough to add the path, but can anyone suggest how to enclose the line number in brackets? Ron ___ 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] Re: Legal registers
> Hi All. Does it somewhere specify that avrgcc and its library > routines should only use a subset of the AVR registers (say Thanks for the replies. Saving all 32 seems the only safe option. Ron ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
[avr-gcc-list] Gcc error message format
I just realised the other day that I can use MS Visual Studio as the complete IDE for my AVR projects. And IntelliSense is very handy. Only trouble is getting auto-error location working (ie you click on the error message and the IDE takes you to that line in that source file). VS requires the error line to specify the complete path to the source file and have the error line number in brackets, eg D:\AVR\Project1\Main.c(123) : error... Whereas gcc presents an error as: Main.c:123: error... Easy enough to add the path, but can anyone suggest how to enclose the line number in brackets? Ron ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list