ASF Complete Guide Request

Go To Last Post
44 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello All,

Is there any complete guide/book for ASF which explains how to use I/O pins, how to use timers, how to use interrupts etc. I would like to start avr programming with AVR Studio 5, I tried to find some docs or books however I couldn't find any complete thing. Would you please help me on that?

Thanks,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aren't the ASF's example projects an incredible good guide by themselves?

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes there are example projects but I am asking for a document, a read book here. Of course example projects are great things for learning but I think they are not enough, they can't teach you everything in detail. There should be some documents, books about that, am I right?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like you ask for the device datasheet in the original post (-;

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hce is right on that!
The device datasheet, and application notes on Atmel's website combined with the ASF examples are more than enough to learn everything you need to program the AVRs, but you need a good C background (and perhaps ASM as well depending on you project's requirements).

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The key to a good software library - like ASF - is good documentation aimed at the expected user of the code. Presumably ASF is aimed at those who want the complexity of setting up ADC, timer, SPI, whatever taken off their hands? So offering a dry description of the API or suggesting "read the datasheet" is not, in my umble opinion, much of an answer.

In previous discussion about ASF I've made the comparison with Arduino. Suppose I want to know how to operate the UART in that (they call this class "serial") then I read documentation like this:

http://arduino.cc/en/Reference/s...

and taking one of the methods such as .write:

http://arduino.cc/en/Serial/Write

The most useful thing on that page (IMAO) is the "Example". That clearly shows a complete (minimal) program that shows the context in which the function is used.

When I think back to when I learned C the reference I always used for the C library was the Borland 3.0 C library reference. This was a most excellent manual because, for each function like malloc() or strcpy() or printf() it not only told me things like the parameter types and also which .h file (stdlib.h, stdio.h, etc) I needed to use but the absolutely key thing was that every function had a complete, compilable C program that showed the function in question being used in context. What's more if the example was for malloc() (say) it would also show free() being used at the end - something a beginner might not realise was required.

Another thing it had was a "see also:" section for each function so strcpy() would have at least strncpy() listed as an alternative which would invite the curious to then look at that one and see how it differed (and hopefully spot why it's actually the better solution!)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In my humble opinion the ASF and the Arduino are targeted and very different end users. The Arduino stuff is more for hobbyist whereas the ASF is meant for real products development. From my experience I've realized that most of the ASF drivers need some optimizations and customization in order to fit the project needs, but they are a very good starting point.

Personally I think that Atmel has done a great job in writing all the ASF drivers and examples in order to flatten the learning curve of their MCUs and to speed up time to market. I work for a multinational company that buys millions of MCUs from many manufacturers, and because of that we have dedicated support from them, and they often write drivers for us, and believe me, there is absolutely no documentation never (aside from the comments in the code). Their chips also come with many bugs, and we need to wait for months until a workaround is found and wait a lot more until a new revision with the bug solved is given to us.

People in this forum is always complaining about Atmel erratas, poor documentation, the problems with AVR Studio (which is 100% free), and so on. Come on people, land into the real world!, these problems are common with all MCU manufacturers... You want a bug free IDE with C compiler, then buy one!, you want a tutorial and a documented ASF, forget it, you are asking for too much.

I am sorry but this is how this works, in the meantime, I am happy with all the free stuff Atmel gives me so I can develop my hobby projects. At this moment I only use the AVRs for my personal projects, but I have used them before for developing real products in previous jobs, and the ASF proved to be extremely helpful.

I encourage anyone in this forum to name a MCU family that has: a bug free IDE with C compiler + a software library as complete and full of examples as the ASF + a silicon revision free of bugs and erratas + affordable hardware debuggers like the dragon.

Is there any?

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I encourage anyone in this forum to name a MCU family that has: a bug free IDE with C compiler + a software library as complete and full of examples as the ASF + a silicon revision free of bugs and erratas + affordable hardware debuggers like the dragon.
LPCXpresso with CodeRed version of Eclipse and brilliant starter libraries. You can buy an Xpresso that includes both CPU board and a debugger more highly specified than Dragon for $20.10 at digikey.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How do you overcome the 128Kb download limit of the free LPCXpresso?

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

and back to the main theme. sma once asked what in our humble opinion would be nice to have concerning the asf...

I gave some suggestions how to improve it:
https://www.avrfreaks.net/index.p...

I add another point now:
For beginners a comprehensive online documentation and even better a wiki would be great.

For me as a professional - I have everything I need, except the points I've asked for in the uper post.

-sb

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Off course there are many ways to improve the ASF, is not perfect, and a comprehensive API documentation would be more than welcome, but, many people think that they can develop MCU software without reading the device's datasheet, and they are wrong.

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

maybe not the complete documentation that you want but are aware of what exists IE:

http://asf.atmel.com/docs/latest/

or start Studio 5 or 5.1, on start page select tools help tab, then click software, NOW ASF IS NOT LISTED HERE (maybe Atmel will notice that), but select any of the 4 and when help opens in browser, left panel on top click library home, and then there are sections for ASF by specific chip type supported.

Hope something in there helps...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would agree with Cliff.

The old PC TurboC would give small compilable code examples. I can also remember the MarkWilliams Coherent operating system. Their documentation was excellent and in one almighty printed manual.

I am sure that a small team can create this sort of quality. And if 'online', it can be kept up to date.

You are never going to have a comprehensive doc + example system. Even something like the Texas 'Stellaris Driver Library' document is very usable.

Regarding house style. You just choose it, stick to it, and let the users put up with it. The actual style matters less than its consistency (to the readers).

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Imho Atmel provides here an "over average" BSP with a licence that fit's well to the needs of comercial companies. Documentation and tooling is even better :-)

I don't know who hosts this forum.
But a wiki would definitely help both, beginners and professionals. I have also the impression, that Atmel's public bugzilla is not really "lived". Support is really good if you get adressed directly to Norway.

Keep this up!

;-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

How do you overcome the 128Kb download limit of the free LPCXpresso?

Why do you need to? If you are programming the same kind of 1K, 2K, 4K, 8K apps you put in AVR8s how the hell do you fill 128K?? There are only 2 models of AVR Mega with more memory than 128K.
Quote:

The old PC TurboC would give small compilable code examples.

In another thread earlier today I was extolling the virtues of:

http://www.cplusplus.com/referen...

For me that's the perfect API reference. True it just happens to be about the C standard library but if other documentation matched this I think we could all be happy!

Dare I mention it but I believe MSDN online comes a close second to this.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PS.: I'm talking about a wiki with suitable and comprehensive content.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

PS.: I'm talking about a wiki with suitable and comprehensive content.


There was such a wiki in the past - maybe because the server ran on baked bean farts very few people used it - I don't know? - but it rather seemed to die a death.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's nothing in it and it's freaking slow, almost dead.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe it's because it makes more fun to answer questions rather than write things down all you superfreaks? ;-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Maybe it's because it makes more fun to answer questions rather than write things down all you superfreaks?

Perhaps - though you will find a number of "permanent" articles in the Tutorial Forum here written by "regulars". If you put all that together you'd have the makings of a fair old wiki.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

danicampora wrote:
you want a tutorial and a documented ASF, forget it, you are asking for too much.

Actually, I don't want it from Atmel. I am currently working with some microcontrollers from some other companies and I think that Atmel's products -generally- more stable. So, I wanted to migrate to Atmel and asked the question. Of course I can learn from example codes, asked questions on similar forums etc. But the point is that; as you know there are a lot of books for a lot of microcontrollers/frameworks. I just couldn't believe that there is no one for Atmel's ASF. I wanted to be sure.

Thanks,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I just couldn't believe that there is no one for Atmel's ASF. I wanted to be sure.

It's too new for there to be 3rd party books just yet. I imagine 3rd party authors are waiting for the dust to settle - perhaps waiting for more tiny/mega support for example?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

How do you overcome the 128Kb download limit of the free LPCXpresso?

Quote:

Why do you need to? If you are programming the same kind of 1K, 2K, 4K, 8K apps you put in AVR8s how the hell do you fill 128K?? There are only 2 models of AVR Mega with more memory than 128K.

Why would you want a 256Kb Cortex-M3 if you are writing a 2KB app? Those devices (like the AVR32) have Ethernet and USB interfaces. Write a complex app with TCP/IP and USB stack and you will quickly reach the 128KB barrier... By the way, does the brilliant LPCXpresso libraries include free USB and TCP/IP stacks, optimized DSP routines like the ASF, and many many cool example application like MP3 decoding, USB bootloader, etc. (the list is interminable...)?

I don't know about the 8 bit AVRs, but the AVR32 sections of the ASF are unbeatable.

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Why would you want a 256Kb Cortex-M3 if you are writing a 2KB app?

Who wants a 256KB M3 ? If I was using M0's and M3's to replace AVRs (mega48. mega88, mega168, mega164, mega324, mega644 etc) I'd be using 8/16/32/64K chips.

If you are in the realms of Ethernet and USB hosting would you use an A8 and do it properly? In that case you'd likely use Linux and do all your development using GCC on Linux (I know I do).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

LOL! This thread gets really funny. Just think about to compare a tiny... whatever with a Cortex... A8/A9 !?

Asf is nice but regrettably not cool. If you wan't something cool than move over to ARM and check out:

http://www.genode.org

-sb

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Regarding ASF, it is not worth wasting time with it. ASF is badly designed and wrongly structured from the ground up.

I find it hilarious that some posers claim as professionals they do need and use ASF, but don't need it to work correct, don't need good documentation and don't need example code, because they are professionals.

If not wishing to and not actually wasting time with ASF makes me a non-professional, so may it be.

david.prentice wrote:
I can also remember the MarkWilliams Coherent operating system. Their documentation was excellent and in one almighty printed manual.

And written by one single guy. 1000+ pages of very well written documentation. I still have the 3.0 manual on my bookshelf.

The whole Coherent OS was written by a handful of people. Certainly fewer than it took Atmel to adapt an IDE, a compiler and write an all messed up library.

Quote:

I am sure that a small team can create this sort of quality.

A single person could. The only requirement: talent.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

If you are in the realms of Ethernet and USB hosting would you use an A8 and do it properly?

Thats a short sighted comment... there a lot of ethernet and USB applications that do not need linux and certanly wouldn't benefit from having it. I guess the great number of flash MCU with ethernet and USB that every manufacturer is making are just there to keep their designers busy, but nobody is actually buying them.

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I find it hilarious that some posers claim as professionals they do need and use ASF, but don't need it to work correct, don't need good documentation and don't need example code, because they are professionals

I already said that the ASF is not perfect, but is a good starting point for your own drivers. And what do you mean by no example code? The ASF is full of it...

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

danicampora wrote:
Quote:

If you are in the realms of Ethernet and USB hosting would you use an A8 and do it properly?

Thats a short sighted comment... there a lot of ethernet and USB applications that do not need linux and certanly wouldn't benefit from having it. I guess the great number of flash MCU with ethernet and USB that every manufacturer is making are just there to keep their designers busy, but nobody is actually buying them.

I'm not so sure about that! Ok, there might exist tons of products out there (and may still be under development), that do not need so powerful devices. But in the end our world get's more and more complicated and that's also the case for embedded systems. Or do you talk about the midrange controllers like uc3?

In my daily work I'm faced to complex ECUs that use sophisticated system architectures with multiple different processors, micro-controller and FPGAs.

In times of multcore and asics we do not have the time to write all our drivers by ourselves. Rather we need new technologies like virtualization to cope with future challenges. And embedded processors will get more and more powerful and complex (e.g. SoC).

I need to reuse code and asf is more than a bad designed software framework! It enables me to get things done. Some 10k+ guys may prefer to implement their own drivers efficiantly maybe in assembler with a very small memory footprint. That might be cool! But I have the feeling ohters just like to talk about it, tell us that things are bad, rather than put in their own work to make things better. Maybe they even don't know how it is to get complex projects done in the real world.

-sb

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sambrown wrote:
Maybe they even don't know how it is to get complex projects done in the real world.

This repeated "you aren't a professional if you don't use ASF" argument gets boring. Care to come up with a real argument instead?

And really, if the economical use of my time dictates to not dig through the ASF mess and to not debug it, makes me a non-professional, then I am happily a non-professional. And as such a non-professional I like to stay away from professionals who use ASF in critical stuff like ECUs. There is a difference between getting things done, and getting things done right.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ArnoldB wrote:

This repeated "you aren't a professional if you don't use ASF" argument gets boring. Care to come up with a real argument instead?

never said that!

you mix statements of different persons together:

ArnoldB wrote:

I find it hilarious that some posers claim as professionals they do need and use ASF, but don't need it to work correct, don't need good documentation and don't need example code, because they are professionals

this is not very hilarious!

-sb

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Or do you talk about the midrange controllers like uc3?

Yes, I've always been talking about midrange 32-bit controllers like the UC3...

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Might be the case that some products in that market segment are no big sellers and maybe they will never be.

In the end the demand for such devices will adjust and in many cases will wipe away their existence.

-sb

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't think sample programs are an adequate replacement for documentation. Now, I haven't had a chance to look at the ASF samples, but one I'm struggling with:

The example programs aren't syntactically correct. I can't build and run them.

The example programs are mostly code having nothing to do with the library I'm trying to use, like making a fancy user interface.

The example programs don't tell you what all the output values are or mean. You just get a "status" that says something like "authorized, declined, captured, approved..." and there is not guidance to tell you what are the "correct" responses to each of the commands.

The example programs never tell you what all the parameters are or mean. It may show an input parameter set to 33, but what does 33 mean? If it always has to be 33, then why is it a parameter?

As it turns out, after wading through hundreds of pages of sample program, the parts having to do with the library are only about 1/2 a page.

Now this could be on a web page with links to pages explaining the various input and output parameters. This would give you a quick, "how to make it work" section right at the front, then the details you have to know to put it into your application.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Torby wrote:
I don't think sample programs are an adequate replacement for documentation. Now, I haven't had a chance to look at the ASF samples, but one I'm struggling with:

The example programs aren't syntactically correct. I can't build and run them.

The example programs are mostly code having nothing to do with the library I'm trying to use, like making a fancy user interface.

Sorry, I really don't have a clue what you're talking about. The ASF is a board support packages that provides us with ready to use drivers for each peripheral of e.g. common UC3 chip(s). All drivers supply ready to compile Make projects for different evaluation boards. The software architecture is ok, since it's easy to integrate them into new projects.

Additionally the ASF provides services (like a USB stack), applications and components, ready to be used and to demonstrate how all these software components work. It supports standalone and FreeRTOS runtime environments and integrates thirdparty software like lwip.

We allready have mentioned that there are a lot of things to improve.

But how can it be, that I again have to read such stupid posts that let me wonder if these guys are talking about something completeley different or ...?

I'm really tired of you guys and will continue to help others that come along with real technical problems!

-sb

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My point was, sample programs are not documentation. Perhaps a useful part of documentation.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am a professional sw and hw designer and after my experiance 20+ years I am not willing to search for every information (ASF documentation + application not + data sheet ++++) It tooks to much time to solve small problems which could be explained in documentation and small code examples. Please can anyone explain the use of DMA transfer and MCI sd card interface. If I write files using ASF FAT library is it done using DMA? Such information is missing I need a clear overview document explaining the structure and switches used in the modules.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Please can anyone explain the use of DMA transfer and MCI sd card interface. If I write files using ASF FAT library is it done using DMA? Such information is missing I need a clear overview document explaining the structure and switches used in the modules

By default the supplied ASF drivers don't use the DMACA module, however, the routines for writing and reading multiple packets are already there (in the sd_mmc_mci.c) and work like a charm. You just need to make a few changes to the sd_mmc_mci_mem.c and to the conf_acces.h the file. I will tell you the exact changes you need to make when I get home later today.

By the way, it only took me around 15 minutes to figure what needed to be changed to use the DMACA...

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@mruch: you're not willed digging in the dirt after 20 years?
lol, then hire someone that does it for you ;-)

I already mentioned that best practices and lessons learned are missing in the ASF documentation...

@daniel: wouldn't it be great to have that information inside a wiki?

-sb

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@danicampora
I am very interested in your code!
I need non blocking code!
How did you code the synchronization between DMA and the FAT library?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Me too, but it might be a good idea to open a new thread for that, since this one is named "ASF Complete Guide Request".

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

How did you code the synchronization between DMA and the FAT library?

There is no need to synchronize the FAT library with the DMA, the FAT library doesn't care if the functions use the DMACA or not. However, the FAT library is hardcoded to use the read and write routines that only manage one sector at a time, if you want to use the multiple sector read/write routines then there is some tweaking that needs to be done.

When I get home tonight I will open a new thread for this where I'll post the code and explain everything.

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry for the delay, here is the code:

https://www.avrfreaks.net/index.p...

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0