header files

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

hi guys,

i worked in a company where they used codevision with al the header files for the microprocessors from atmel and stuff.

now i'm back home and i want to use the programmer that i made. the problem is that i now need to use avrstudio. as compiler i downloaded winavr. the problem is that i don't have the header files for the the processors.

does anybody know where i can find those.

thanks

Robbin

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

If you installed WinAVR then yes you do. Have a look in \winavr*\avr\include\avr

But note that in WinAVR you never normally need to access them directly (expect to check details) all your avr-gcc programs just start with:

#include 

and your MCU= choice in the project/Makefile dictates which of those many .h files in that directory actually gets pulled in by avr/io.h

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

If you mean the header files for the individual AVR models, you don't need to include them directly. You include and set the AVR model in the compile options. If you really want to see them, they are in avr/include/avr.

Edit: Cliff beat me again!

Regards,
Steve A.

The Board helps those that help themselves.

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

An additional heads up here. There are differences between codevision and avr-gcc/winAvr. So don't expect your code to just work by recompiling from one to the other.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

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

But codevision had an include for each avr model, so you will need to do a little editing on your c files. There probably isnt any reason that winavr projects couldnt have processor specific includes in the main file, but that info is in the makefile 'traditionally', and the makefile would have to be tailored somehow...

Imagecraft compiler user

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

oke it's working now thanks. there are a few difference between codevision and AVRstudio.

i have an program now and i wanna program my atmega 16,

if i use tools --> prog avr then i use the option ' use current simulator to program flash/eeprom. when i do this i get an error like ' JTAG error mode.

the code i used is to simple:

#include 
#include 


void main(void)
{

  DDRB = 0xFF;   //  We put port B pins in output mode  
  PORTB = 0xFF;   // put all leds in off state 
  DDRD = 0xFF;    // We put port D pins in output mode  
  PORTD = 0xFF; //  we activate the internal pull-up


   
  
  
 while(1)
 { 
 // walking led on Port B;

      PORTB = 1; // walking led 
 
        }
      }

i did a signature read and it detects my atmega 16.

thanks for the help.

Robbin

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

bobgardner wrote:
There probably isnt any reason that winavr projects couldnt have processor specific includes in the main file,

There is a reason why the processor specific header files are not included directly. Look at the header file to find out.

That is why it is never recommended to include the processor specific header files.

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

for some reason it's working now, don't really know why :P but it's working :P

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

Quote:

But codevision had an include for each avr model, so you will need to do a little editing on your c files.

or simply "#include "

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.