Please recommend IDE for atmega microcontroller

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

I am new to embedded world i don't know much knowledge.  I work on windows 10.  I am looking IDE for atmega328p.  There are many IDE available online like Atmel Studio, code-blocks eclips. I need to use only one.  recommend me most popular IDE for atmega  

 

My hardware 

 

Thanks & regards 

Gandhi

Last Edited: Wed. Feb 26, 2020 - 02:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 'most popular' would be Arduino. Especially since you are using the mega328.  The Microchip/Atmel 'recommended' IDE is Atmel Studio 7. My personal recommendation would be platformIO. 

 

 

Note - your 'hardware' has 1nF caps for C1 and C2 - that won't work in the real world. 15-22pF would be more realistic. You have no power connections nor any bypass capacitors. Refer to the Arduino Nano schematic for a valid circuit.

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

Welcome to AVRFreaks.

 

"most popular" ... strictly by numbers is probably the Arduino IDE.

 

Also I recommend this link to you.

 

https://www.avrfreaks.net/forum/...

 

Ross McKenzie ValuSoft Melbourne Australia

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

For an easy life when it comes to simulating and debugging you won't find a better option than Microchip's own Atmel Studio 7 I don't think.

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

gandhi1 wrote:
I need to use only one.
For you, one may do though your customers may have already selected an IDE.

gandhi1 wrote:
recommend me most popular IDE for atmega
Conversely, Microsoft Visual Studio Code.

 


https://www.avrfreaks.net/forum/come-join-us-mplab-now-supports-avrs?page=5#comment-2789911

mega328P is in the tested state with MPLAB PICkit 4 In-Circuit Debugger and the AVR CPU simulator.

 

https://www.avrfreaks.net/forum/avr-studio-mac-linux#comment-2600281 (Visual Studio Code, Arduino Uno, debugWIRE)

AVR in VS Code | AVR Freaks

with some effort, Microchip's AVR simulator via AVR GDB :

GitHub - xoriath/vscode-atmel-debug: Debug adapter for Visual Studio code for the Atmel debug backend

 

edit :

UltraEdit / UltraStudio as an alternative to MPLAB-X? | Microchip

UEStudio is a powerful IDE combined with UltraEdit text editor

Working Outside of MPLAB® X IDE - Developer Help

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Feb 26, 2020 - 05:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

For an easy life when it comes to simulating and debugging you won't find a better option than Microchip's own Atmel Studio 7 I don't think.

I have downloaded atmel studio 7 

 

Kartman wrote:
You have no power connections nor any bypass capacitors. Refer to the Arduino Nano schematic for a valid circuit.

I don't think problem with VDD and GND in proteus simulator. It takes bydefault  

 

There may be problem with code

 

/*
 * Problem statment 
 * Device : Atmega328
 * Language: C 
 */ 

#include <avr/io.h>
#include <delay.h>

int main(void)
{
	
	 DDRB = 0xFF;         //PB as output
	 PORTB= 0x00;         //keep all LEDs off
		
    /* Replace with your application code */
    while (1) 
    {
		   PORTB &= 0b11111110;       //turn LED off
		   delay_ms(500);   //wait for half second
		   PORTB |= 0b00000001;       //turn LED on
		   delay_ms(500);   //wait for half second
		
    }
}

 

Program compiles with no error but When I run code  led is not blinking 

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

When I run code  led is not blinking 

Why would it blink when the led is on portD?  I try to remind myself to take time to pay close attention to details (sometimes it helps!)

 

For the delay function, don't you have to initially specify the system clock freq (or perhaps there is a default)---I don't know.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. Mar 1, 2020 - 09:42 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh come on Mr Ghandi,

gandhi1 wrote:
I am new to embedded world i don't know much knowledge

Surely not so little that you cannot cross reference your schematic with the code you wrote.

As you have access to Proteus Simulator (the rest of us don't get to play with such nice toys) I guess you are at school/college and learning embedded, some say the best way to learn is to make mistakes:

Your code uses a perfectly sensible pin for the LED but using RX in the schematic was probably the worst choice you could have made.

 

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

N.Winterbottom wrote:

Oh come on Mr Ghandi,

gandhi1 wrote:
I am new to embedded world i don't know much knowledge

Surely not so little that you cannot cross reference your schematic with the code you wrote.

As you have access to Proteus Simulator (the rest of us don't get to play with such nice toys) I guess you are at school/college and learning embedded, some say the best way to learn is to make mistakes:

Your code uses a perfectly sensible pin for the LED but using RX in the schematic was probably the worst choice you could have made.

 

 

This is complete solution

 

 

 

Program 

#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
	DDRD |= (1<<DDD1);
	while (1)
	{
		PORTD |= (1<<PORTD1);
		_delay_ms(500);
		PORTD &= ~ (1<<PORTD1);
		_delay_ms(500);
	}
}

 

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

Hello,  welcome to the world of embedded system development.

 

If you are using the Atmel AVR ATMega328P as a microcontroller, then by far the best IDE is the Arduino system along with the Arduino UNO or Nano as a hardware platform (both use the ATMega328P device as a base CPU).  The 20-year-experienced professional engineers here will probably recommend something different (generally for reasons that have no relevance to you as a beginner), but don't pay any attention to them.  At the entry level, Arduino has the entire development process ready-to-go and minimizes the amount of time that you need researching, testing, and debugging in order to get your application ready for market.

 

Plus it's free,  and it ... just .... f***ing ....works.  Did I mention that Arduino is free? and that it is the IDE that is most likely to have your application actually work if you load and run the tested and debugged example code that comes with the free and tested downloadable libraries for your sensors and actuators?  

 

But you ask:  When should you use a "better" IDE than the Arduino system?   When someone is paying you to $80,000 a year to be a professional embedded-systems engineer.   Until then, life is too short to mess with anything but Arduino for Mega328P AVR development.

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

This is complete solution

Hardly, unless you are telling a bad joke. 

Your reset pin can't go low, thus no ISP programming will be possible.
Aref should NOT connect to Vcc, it should instead connect to a capacitor to gnd.

You don't show capacitors for your Vcc power connections--do you have them?  It is imperative!

 

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

The 1nF caps on the crystal aren't going to work too well. I pointed this out in #2. Of course, this is a simulation, so it doesn't make any difference.

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

 

Of course, this is a simulation, so it doesn't make any difference.

Well, of course not!    

 

The Computer Simulation That Almost Started World War III

https://gizmodo.com/the-computer-simulation-that-almost-started-world-war-i-1686123550

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

Simonetta wrote:
But you ask:  When should you use a "better" IDE than the Arduino system?  
Where is the source browser in Arduino ? Now perhaps the promised "Arduino Pro" has such basic things but the basic Arduino IDE itself surely does not.

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

Simonetta wrote:

Plus it's free,  and it ... just .... f***ing ....works.

 

Used to think so too, until a couple of days ago when I found - the hard way, of course - that a bug in recent versions messes the PWM output on Arduino Mega boards (about as basic functionality as you can ask for):

https://github.com/arduino/Ardui...

 

That is not to say, of course, that other IDEs are error-free... frown

 

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

gandhi1 wrote:

This is complete solution

 

No. Just no. See this post...

 

https://www.avrfreaks.net/forum/...

 

 

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

I use the Arduino IDE for .ino files only.  I assume that is the source browser as .ino is the main part of Arduino source code and it can be used as a text editor.   For .cpp, .h, and text files, I use a separate text editor... UltraEdit, but any text editor could be used.   Ultraedit can also be used to send command line statements to the PC.   So if the bootloader stops working, I can still load the AVR by using the hex file created by Sketch:Export Compiled Binary (and using AVR ISP).

   I recommend Arduino for beginners because it incorporates all the processes of Embed Dev into a single system that is cheaper, more reliable, and better supported than any commercial system.  I assume that anyone claiming to be a beginner is not inside a corporate structure that will pay for a "better" IDE system and has knowledgeable people near that can answer all the questions that seem to  pop up.

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

OP asked for an INTEGRATED Development Environment. It's hardly integrated if you are forced to use external editors because the "IDE"s own editor is sub-standard.