AVR Assembler article
-
C++ is a hard push on any embedded system, most are still stuck in C. I tried to convince an old developer to use C++ on an ARM once, he nearly had me crucified.
It's hard to get people to change I've been in a couple of positions where I've pushed C++ even to the point of writing a framework, giving classes and such but they were set in there ways and I finally just did my own thing and left them to there's. I'm using the ATMega1280 and ATMega2560 boards for my C++ projects and the have 128K and 256K flash memory respectively so there's no "limited memory" excuse and since C++ runs just about as fast as C that shouldn't be a problem. The IDE has finally started to support it and I've been writing a lot of libraries in C++.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
I for one would be most interested in an article of that nature. With the 328p having such limited program/memory space, I'd love to see such an article.
I have done a couple of project using the 328P and C++ and it works very well.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
I have done a couple of project using the 328P and C++ and it works very well.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
Indeed. I've done a couple too. But as with desktops, sometimes a c/c++ just doesn't seem to cut the mustard. (using avr-gcc here) One cant be sure that a register value wont be chucked away or that a register wont be loaded twice. Specifically, I'm playing with (a) a musical instrument synthesizer with waveform display and am looking to add the ability to add tracking info - i.e Make an (amiga) .mod player. (b) a cheap and nasty DSO/bus sniffer (c) a 6, 7 or 8 channel RX compatible with the protocols used by both the Turnigy 9x and Husban transmitters. Every byte left is well appreciated, sine they each use a channel-hopping protocol and have rather short frame-times. I need a couple of largish static buffers and few wasted cyles. To maintain a lock and avoid dropping packets, one needs to be rather efficient with the 328. I'm able to successfully change channel between each packet, but still cant capture more than about 5 or 6 packets in a row before I drop one. Interference isn't the problem, it's just a matter of timing. So memory for the channel hopping tables and speed to avoid packet loss are my main interests. This also means that an a7105 2.4ghz module driven by the 328 doesn't satisfy the binding requirements of either a commercial Turnigy/Hobby-King RX.
-
Does this subject appeal to the masses here?, and would anyone be interested in it? I have it on my site and it gets a lot of hits but don't know if it would be an interesting addition here.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
It certainly will be. I am learning AVR Assembler as a part of my Apprenticeship, using the STK 600 Board[^]. We are currently implementing a Real Time Clock, being triggered by the interrupt signal. Maybe I am going to put it up here when it is finished.
Veni, vidi, caecus | Everything summarizes to Assembly code
-
Does this subject appeal to the masses here?, and would anyone be interested in it? I have it on my site and it gets a lot of hits but don't know if it would be an interesting addition here.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
Does this subject appeal to the masses here?, and would anyone be interested in it? I have it on my site and it gets a lot of hits but don't know if it would be an interesting addition here.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
As you say nothing ventured nothing gained. I'm working on converting it now and should be ready in a couple of hours.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
As you say nothing ventured nothing gained. I'm working on converting it now and should be ready in a couple of hours.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
Does this subject appeal to the masses here?, and would anyone be interested in it? I have it on my site and it gets a lot of hits but don't know if it would be an interesting addition here.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
Should be similar. Published it about 1-2 hours ago! AVR Assembler 101[^]
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
Does this subject appeal to the masses here?, and would anyone be interested in it? I have it on my site and it gets a lot of hits but don't know if it would be an interesting addition here.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
I have done a couple of project using the 328P and C++ and it works very well.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
Does this subject appeal to the masses here?, and would anyone be interested in it? I have it on my site and it gets a lot of hits but don't know if it would be an interesting addition here.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
Well, anything Low Level get my vote :)
-
Well, anything Low Level get my vote :)
Thanks Glenn, I submitted it yesterday and it's getting a fairly good reception so I guess a lot of people think like us. :)
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
Most of the Arduino boards use a processor with 32kB flash ('328, or '32), and all use C++ for 'wiring' code http://arduino.cc/en/Products.Compare[^]
A lot of hobbyists use the Arduino IDE which has a lot of C++ code and I don't use it so haven't delved to deep in it. But most people that use it seriously use Asm or C for production!
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
I'm working on AVR so wouldn't mind you posting on it. But whether anyone else would be interested on CP I don't know.
"Program testing can be used to show the presence of bugs, but never to show their absence." << please vote!! >>
Submitted it yesterday AVR Assembler 101[^] Didn't realize so many people on CP were interrested or worked on AVR.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
Does this subject appeal to the masses here?, and would anyone be interested in it? I have it on my site and it gets a lot of hits but don't know if it would be an interesting addition here.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
count me up as interested :)
-
count me up as interested :)
Done! AVR Assembler 101[^]
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
-
It's hard to get people to change I've been in a couple of positions where I've pushed C++ even to the point of writing a framework, giving classes and such but they were set in there ways and I finally just did my own thing and left them to there's. I'm using the ATMega1280 and ATMega2560 boards for my C++ projects and the have 128K and 256K flash memory respectively so there's no "limited memory" excuse and since C++ runs just about as fast as C that shouldn't be a problem. The IDE has finally started to support it and I've been writing a lot of libraries in C++.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!
Mike Hankey wrote:
I'm using the ATMega1280 and ATMega2560 boards for my C++ projects and the have 128K and 256K flash memory respectively so there's no "limited memory" excuse and since C++ runs just about as fast as C that shouldn't be a problem. The IDE has finally started to support it and I've been writing a lot of libraries in C++.
The "memory problem" rather lies in the fact that even on a Mega2560, you still have only 8KB of RAM. So you have to still be fairly conscious about any dynamic memory allocation (avoid virtual methods at all cost) on top of the fact that AVR MCUs are prone to lock up on heavy memory fragmentation... And the Arduino IDE was always using C++, the "sketch" that you write is nothing more than an include file for a main() file wrapper and the "Arduino language" isn't actually more than using methods of the default libraries (which in turn are written in C++). After all, the compiler underneath is nothing more than a AVR targeted GCC (ok, there's now a ARM option to support the Due and Intel has their own version of the IDE to support the x86 in their Galileo board). Ralf ;)
-
Mike Hankey wrote:
I'm using the ATMega1280 and ATMega2560 boards for my C++ projects and the have 128K and 256K flash memory respectively so there's no "limited memory" excuse and since C++ runs just about as fast as C that shouldn't be a problem. The IDE has finally started to support it and I've been writing a lot of libraries in C++.
The "memory problem" rather lies in the fact that even on a Mega2560, you still have only 8KB of RAM. So you have to still be fairly conscious about any dynamic memory allocation (avoid virtual methods at all cost) on top of the fact that AVR MCUs are prone to lock up on heavy memory fragmentation... And the Arduino IDE was always using C++, the "sketch" that you write is nothing more than an include file for a main() file wrapper and the "Arduino language" isn't actually more than using methods of the default libraries (which in turn are written in C++). After all, the compiler underneath is nothing more than a AVR targeted GCC (ok, there's now a ARM option to support the Due and Intel has their own version of the IDE to support the x86 in their Galileo board). Ralf ;)
Bitbeisser wrote:
The "memory problem" rather lies in the fact that even on a Mega2560, you still have only 8KB of RAM
Agreed but that is always a consideration no matter what language you are using.
Bitbeisser wrote:
(avoid virtual methods at all cost)
Why? It just uses a virtual table right? I tend to stay away from doing to much dynamic allocation because as you say memory does get fragmented easily and the memory management sucks.
VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!