Hi.OK, i assume you have started Studio and on the start page you clicked from the left the "New Project..." link. That will pop up the new project dialog where these different boards are shown. Don't pay attention to them, they are all either for specific Atmel demo boards or Arduinos or processors not relevant to you. Instead click on the first item on the list (C/C++) after which the center list will change to show project templates for generic C and C++ executables and libraries. Select either C or C++ executable depending on which language you are going to use. Before clicking do fill the bottom edit fields i.e. Project Name, Location and Solution names as appropriate, paying attention to the check boxes on the right. Once those are correct, click on the language selection and you will proceed to select the specific processor from a list of all Atmel chips supported by Studio. That's it really. Once done, you will get the main source file open in the editor and you can start hacking to your heart's content.
I've done tons of projects with all sorts of cpu-s and mcu-s, but I always somehow avoided using AVR stuff.
In my latest project I need the Atmega162@8MHz because it has a parallel bus interface dip package and two uart-s.
I tried using AVR studio 6, but I don't know how to setup the project.
It offers me arduino boards, atmel boards and user boards. The user boards have all sorts of markings, but I don't know what do I need to select.
I just want to make a blinking led program for the atmega162 in a decent environment.
I also have winavr, but that just keeps crashing, so that is hopeless.
What makes you think you killed it?Because the bus pirate gizmo can't connect to it anymore, and when I plug the chip into the universal programmer I only get errors.
How can you bitbang usb anyway? Don't you need to run it on a 48MHz clock or something like that?
It uses the compilers command-line switch "-mmcu=" (supplied by IDE for your project) to set the correct register addresses for your selected MCU.Thanks.
So, including io.h gets all your io addresses for your mcu automatically.
I imagine interrupt.h, wdt.h etc. do the same thing
MCUCR=0b11000000;
DDRC = 0xFF;
PORTC = 0x00;
EMCUCR=0b00001111; /*long cycle for slow peripherals*/unsigned char *p;
unsigned char b_rd(unsigned short A)
{
PORTC=A>>8;
return p[0x8000+(A&255)];
}
void b_wr(unsigned short A, unsigned char B)
{
PORTC=A>>8;
p[0x8000+(A&255)]=B;
return;
}DDRB=0b11111011;
/*FOC2 WGM20 COM21 COM20 WGM21 CS22 CS21 CS20*/
TCCR2=0b01101011;
OCR2=192;/*non 50% signal*/