.d90 file format

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

How to create a .d90 file in avrstudio 4??

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

You don't, it's an IAR proprietary file format. You need an IAR
compiler for it.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

we r using the evaluation version of IAR compiler now to generate .d90 file...

but even after including "iom16.h" file, it is not recognizing ports and showing errors than ports and registers not defined.

is there any special file that we have to include??

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

Post the code (or at least the lines that are not recognised). Maybe the code has been written for some other AVR where the register names differ slightly?

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

This program is running in avrstudio4 but it is showing errors in IAR compiler even after using the same header files of avrstudio4....

We are including the file "iom16.h" which consists of all the required port definitions.

Errors are-:

115:			TIMSK &=~((1<<TOIE2)|(1<<OCIE2));     //Disable TC2 interrup
Error[Pe020]: identifier "TOIE2" is undefined  115 
Error[Pe020]: identifier "OCIE2" is undefined  115 

116:			 ASSR |= (1<<AS2);           //set Timer/Counter0 to be asynchronous from the CPU clock 
Error[Pe020]: identifier "AS2" is undefined  116 

276:			ISR(TIMER2_OVF_vect)  
Error[Pe079]: expected a type specifier  276 
Error[Pe141]: unnamed prototyped parameters not allowed when body is present  276 

	     #define RS		PC1
1036:			PORTC|=(1<<RS);		
Error[Pe020]: identifier "PC1" is undefined  1036 

	  #define pumprunning	PC4 
Error[Pe020]: identifier "PC4" is undefined  292 

Warning[Pe223]: function "_delay_ms" declared implicitly  1014 

	#define BUSY	PD7  
1077:			PORTD&=~(1<<BUSY);			
Error[Pe020]: identifier "PD7" is undefined  1077 

Thanks for any help in advance.

Attachment(s): 

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

Just a minute, if you are porting this code from IAR to GCC/Studio then what you actually want is to replace the:

#include "iom16.h"

with

#include 

ans just ensure that the project config is set to build for mega16.

The IAR file has:

SFR_B_N(0x39,TIMSK,OCIE2,TOIE2,TICIE1,OCIE1A,OCIE1B,TOIE1,OCIE0,TOIE0)

while the GCC file has:

#define TIMSK   _SFR_IO8(0x39)
#define TOIE0   0
#define OCIE0   1
#define TOIE1   2
#define OCIE1B  3
#define OCIE1A  4
#define TICIE1  5
#define TOIE2   6
#define OCIE2   7

Ultimately they do the same but SFR_B_N() is an IAR specific macro and _SFR_IO8() is a GCC specific one.

Cliff

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

We are porting from gcc to IAR so as to build the .d90 file for simulating LCD interface.

We have included the "iom16.h" and still it is showing same errors.

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

And just to be clear it's the IAR version of iom16.h and not the GCC one that's being used for the IAR compiler? I notice in the tutorials in my copy of IAR that they always include above the inclusion of or whatever. I'm not sure what the significance of that is - but maybe the io-part_num.h is using macros defined within it (like SFR_B_N() etc.)?

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

> 115: TIMSK &=~((1<<TOIE2)|(1<<OCIE2)); //Disable TC2 interrup
> Error[Pe020]: identifier "TOIE2" is undefined 115
> Error[Pe020]: identifier "OCIE2" is undefined 115

IAR has the strange habit to not include register bit name definitions
by default (only register name definitions itself). You have to
define the macro ENABLE_BIT_DEFINITIONS prior to including the IO
definition header file, either with a #define, or from the compiler
command-line. (IMHO the IAR GUI has a clickable option for the
latter.)

> 276: ISR(TIMER2_OVF_vect)
> Error[Pe079]: expected a type specifier 276
> Error[Pe141]: unnamed prototyped parameters not allowed when body is present 276

The interrupt syntax used by IAR is vastly different than the one used
by AVR-GCC. Here's a compatibility macro:

#define PRAGMA(x) _Pragma( #x )
#define ISR(vec) PRAGMA( vector=vec ) __interrupt void handler_##vec(void)

There are probably more things to change, like using
__enable_interrupt() where avr-libc has sei().

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

By the way, 've also just noticed that between the inclusion of and (in the case of the tutorials) they have:

#ifndef ENABLE_BIT_DEFINITIONS
#define ENABLE_BIT_DEFINITIONS
// Enable the bit definitions in the iom128.h file

It sounds a LOT like this is the solution to your problem!

EDIT: Ah ha - Jörg and I posted at the same time. Sounds like that IS the solution then

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

Thanks Jörg and Cliff :D :D

That solved the declaration of ports and registers.

any special file required to use delays in IAR??

We tried to use "_delay_ms(20)" function but it showed warning that its definition is not present.

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

Searching for the word "delay" in the IAR-EW help system leads me to __delay_cycles() - any use to you?