First you must download AVR Studio 4 from Atmel website. Then BASCOM must generate output file that is accepted by AVR Studio.
- Select Options/Compiler/Output from BASCOM menu. Check AVR Studio Object File
- Compile BASCOM program. One more file is generated with .OBJ extension.
- Run AVR Studio 4.
- Select File/Open item from menu.
- Choose file name with .OBJ extension. Because OBJ extension is not displayed by default, it is easier to type entire file name in text box.
- AVR Studio prompts for new project name. Accept default name.
- AVR Studio displays debug platform dialog box. Select JTAG ICE from the
left window. Optionally you can select AVR Simulator to run program under simulator. On the right select AVR chip type, e.g. Atmega16
- Now, you can run your program, execute step by step or set breakpoints.
When you execute program step by step, you note that at the beginning of the program yellow arrow is on the first line regardless key press. This is because of BASCOM initialization code. There is no source for this code, so AVR Studio indicates that it executes the first line (it can be a comment line). It is better to set breakpoint on the first line of source code and press F5, this allows you to quickly skip initialization code.
Unfortunately BASCOM does not store information about variables in OBJ file. That means you can not watch variables. When you try to add variable to watch window, it displays 'Not in scope'. You can still examine registers, memory and so on.