avrstudio 6 project examples

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

how to find avrstudio 6 project examples(led blinking-adc -pwm) ? doesn't it have library examples like micro c ?

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

No. There are some old example files from the GCC installation. e.g. stdiodemo

Atmel has ASF projects, but these are mostly for ARM cpus. ASF is so convoluted, it is difficult to use.

There are loads of GCC examples on the Internet. You just have to find them.

CodeVision comes with Example projects, Help files, ...
Of course, most people ignore them.

If you come from the MikroElektronica background, you will have to learn proper C when you use a proper C compiler. Then run the resultant projects on your MikroElektronica hardware board.

David.

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

Don't forget the "Getting started" section of the Atmel Studio documentation.

Combine that with the "generic blinky" app, for which I sketch the code here:

#include 
#define F_CPU 1000000ul
#include 

int main(void)
{
   // LEDs on PORTD, set all pins of PORTD to output
   DDRD = 0xFF;

   while(1)
   {
      PORTD = 0xFF;
      _delay_ms(500);
      PORTD = 0x00;
      _delay_ms(500);
   }

   return 0;
}

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

The Arduino is the best supported environment. Basically because the target boards are well defined.

Dev board vendors might include examples for their hardware.
Compiler vendors might include examples for their software.

GCC has never really had 'vendors'. So no-one has really bothered to support examples.

So MikroC might provide examples for their boards, but only with their wierd Compiler.

I suspect that several people have ported the MikroC examples to GCC. You could ask on MikroC forums. I doubt if MikroC company would ever co-operate with this.

I am sure that most ideas and projects have already been tried with GCC. And have source code in the public domain. Unfortunately, you will have to adapt them to your particular hardware. Not much more than editing PORT and pin usage.

David.

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

ASF has pretty decent example projects to work with.. You can select an example project based upon the board (atmel evaluation kit) you have and it works.

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

Quote:
ASF has pretty decent example projects to work with..
Have they now added more tiny/mega projects then? Last time I looked I think there was only ADC code for Mega.

Of course if you use a "complex" CPU like Xmega, UC3, ARM then there are tons of useful examples but tiny/mega support looks pitiful.

@OP, have you visited the tutorial forum here? Most of the examples there are written for avr-gcc which is the compiler used in Studio 6. Also look at the "Newbie?... Start here" sticky thread at the top of this forum.

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

what is the equivalent code for reading analog channel in avr studio ?

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

Did you read "Newbie? Start here"? Did you visit the tutorial forum? Were there really no articles about using ADC?

In case it's not obvious the newbie thread will tell you where to look for basic stuff and one of the places it'll tell you to look at is the tutorial forum and there you will find several threads about ADC (and lots of other interesting stuff). There only are 6 pages of thread titles in Tutorial so it's worth reading through all the titles and looking out for anything else that sounds interesting to you.

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

The code is more or less the same regardless of your development environment, as long as you are programming in the C language.

Have you visited the Tutorials forum? There should be at least one tutorial on reading the ADC.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Hello Dave P. Can you list one or two of the things a Mikroe c compiler user might need to watch out for when converting to or from a more ansi-c compatible avr c compiler? This info would be more helpful to new avr/c learners than just being snarky about the Microe c compiler. Sometimes a short cheat sheet with bullets is a big help.

Imagecraft compiler user