Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. AVR Assembler article

AVR Assembler article

Scheduled Pinned Locked Moved The Lounge
comquestion
33 Posts 13 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Mike HankeyM Mike Hankey

    I know there are a few AVR enthusiasts here on CP but didn't know if anyone used assembler. I don't use it very ofter as I'm trying to push C++ now that the Atmel Studio supports it but it is handy to know and the more you know about the hardware the better.

    VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!

    R Offline
    R Offline
    Ron Beyer
    wrote on last edited by
    #5

    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.

    Mike HankeyM 1 Reply Last reply
    0
    • R Ron Beyer

      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.

      Mike HankeyM Offline
      Mike HankeyM Offline
      Mike Hankey
      wrote on last edited by
      #6

      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!

      B 1 Reply Last reply
      0
      • enhzflepE enhzflep

        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.

        Mike HankeyM Offline
        Mike HankeyM Offline
        Mike Hankey
        wrote on last edited by
        #7

        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!

        enhzflepE D 2 Replies Last reply
        0
        • Mike HankeyM Mike Hankey

          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!

          enhzflepE Offline
          enhzflepE Offline
          enhzflep
          wrote on last edited by
          #8

          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.

          1 Reply Last reply
          0
          • Mike HankeyM Mike Hankey

            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!

            M Offline
            M Offline
            Marco Bertschi
            wrote on last edited by
            #9

            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

            1 Reply Last reply
            0
            • Mike HankeyM Mike Hankey

              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!

              D Offline
              D Offline
              DaveX86
              wrote on last edited by
              #10

              +1

              1 Reply Last reply
              0
              • Mike HankeyM Mike Hankey

                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!

                W Offline
                W Offline
                Wendelius
                wrote on last edited by
                #11

                I'd be very interested and what's to loose if you publish it also here :)

                Mike HankeyM 1 Reply Last reply
                0
                • W Wendelius

                  I'd be very interested and what's to loose if you publish it also here :)

                  Mike HankeyM Offline
                  Mike HankeyM Offline
                  Mike Hankey
                  wrote on last edited by
                  #12

                  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!

                  W 1 Reply Last reply
                  0
                  • Mike HankeyM Mike Hankey

                    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!

                    W Offline
                    W Offline
                    Wendelius
                    wrote on last edited by
                    #13

                    :thumbsup:

                    1 Reply Last reply
                    0
                    • Mike HankeyM Mike Hankey

                      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!

                      CPalliniC Offline
                      CPalliniC Offline
                      CPallini
                      wrote on last edited by
                      #14

                      I don't know AVR (I'm on the Microchip side) but would be interested.

                      Veni, vidi, vici.

                      In testa che avete, signor di Ceprano?

                      Mike HankeyM 1 Reply Last reply
                      0
                      • CPalliniC CPallini

                        I don't know AVR (I'm on the Microchip side) but would be interested.

                        Veni, vidi, vici.

                        Mike HankeyM Offline
                        Mike HankeyM Offline
                        Mike Hankey
                        wrote on last edited by
                        #15

                        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!

                        B 1 Reply Last reply
                        0
                        • Mike HankeyM Mike Hankey

                          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!

                          R Offline
                          R Offline
                          R Erasmus
                          wrote on last edited by
                          #16

                          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!! >>

                          Mike HankeyM 1 Reply Last reply
                          0
                          • Mike HankeyM Mike Hankey

                            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!

                            D Offline
                            D Offline
                            Dougy83
                            wrote on last edited by
                            #17

                            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[^]

                            Mike HankeyM 1 Reply Last reply
                            0
                            • Mike HankeyM Mike Hankey

                              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!

                              G Offline
                              G Offline
                              glennPattonWork3
                              wrote on last edited by
                              #18

                              Well, anything Low Level get my vote :)

                              Mike HankeyM 1 Reply Last reply
                              0
                              • G glennPattonWork3

                                Well, anything Low Level get my vote :)

                                Mike HankeyM Offline
                                Mike HankeyM Offline
                                Mike Hankey
                                wrote on last edited by
                                #19

                                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!

                                1 Reply Last reply
                                0
                                • D Dougy83

                                  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[^]

                                  Mike HankeyM Offline
                                  Mike HankeyM Offline
                                  Mike Hankey
                                  wrote on last edited by
                                  #20

                                  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!

                                  1 Reply Last reply
                                  0
                                  • R R Erasmus

                                    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!! >>

                                    Mike HankeyM Offline
                                    Mike HankeyM Offline
                                    Mike Hankey
                                    wrote on last edited by
                                    #21

                                    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!

                                    1 Reply Last reply
                                    0
                                    • Mike HankeyM Mike Hankey

                                      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!

                                      L Offline
                                      L Offline
                                      L e g i 0 n
                                      wrote on last edited by
                                      #22

                                      count me up as interested :)

                                      Mike HankeyM 1 Reply Last reply
                                      0
                                      • L L e g i 0 n

                                        count me up as interested :)

                                        Mike HankeyM Offline
                                        Mike HankeyM Offline
                                        Mike Hankey
                                        wrote on last edited by
                                        #23

                                        Done! AVR Assembler 101[^]

                                        VS2010/Atmel Studio 6.1 ToDo Manager Extension Relax...We're all crazy it's not a competition!

                                        L 1 Reply Last reply
                                        0
                                        • Mike HankeyM Mike Hankey

                                          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!

                                          B Offline
                                          B Offline
                                          Bitbeisser
                                          wrote on last edited by
                                          #24

                                          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 HankeyM 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups