Homebuilt underwater robot

 

Using JTAG with BASCOM program

To run BASCOM program under JTAG, output file must be loaded into AVR Studio.

First you must download AVR Studio 4 from Atmel website. Then BASCOM must generate output file that is accepted by AVR Studio.

  1. Select Options/Compiler/Output from BASCOM menu. Check AVR Studio Object File

    Bascom compilation options

  2. Compile BASCOM program. One more file is generated with .OBJ extension.
  3. Run AVR Studio 4.
  4. Select File/Open item from menu.

    AVR Studio Open/File

  5. 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.

    File list

  6. AVR Studio prompts for new project name. Accept default name.
  7. 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

    AVR Studio debug device selector

  8. Now, you can run your program, execute step by step or set breakpoints.

    AVR Studio BASCOM source code

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 skips 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.