Page 1 of 1

Weird issue with Attiny85

Posted: Thu Dec 19, 2013 1:56 am
by Alberta2012
Hi Everyone,

I wrote a simple program, based on tha ATTiny85. when I try to compile, i get the following error:

G:\Jasmin\PROJET~1\WIP\BLOCKH~1\07-FLO~1\Block Heater Cable V2.c: In function 'main':
G:\Jasmin\PROJET~1\WIP\BLOCKH~1\07-FLO~1\Block Heater Cable V2.c:523: error: 'TIMSK0' undeclared (first use in this function)
G:\Jasmin\PROJET~1\WIP\BLOCKH~1\07-FLO~1\Block Heater Cable V2.c:523: error: (Each undeclared identifier is reported only once
G:\Jasmin\PROJET~1\WIP\BLOCKH~1\07-FLO~1\Block Heater Cable V2.c:523: error: for each function it appears in.)

The problem seems to point to my usage of a time interrupt.

If I take the exact same program, and use another CPU, let's say ATTiny2313, the it compiles OK.

I looked into the resulting C code, and I found the following:

#include <avr\io.h>

when I look into io.h, I found the following:

#elif defined (__AVR_ATtiny85__)
# include <avr/iotn85.h>

So I'm guessing that if the selected CPU is a ATTiny85, is has to load "iotn85.h"

I compared iotn85.h with the one for the ATTiny2313 (iotn2313.h) and found that the one for the ATTiny85 is way, way smaller that the one for the ATTiny2313. The one for the ATTiny2313 has some "define" related to TIMSK (mentionned in the error message of the compiler)..... Is it possible that the iotn85.h is incomplete ? am I totally off ???

looking at the spec sheet of the ATTiny85, it does mention that there is a timer available !!!!

what is going on ?

Re: Weird issue with Attiny85

Posted: Thu Dec 19, 2013 10:50 am
by Benj
Hello,

Looks like there is a bug in the FCD file. I will look into this.

You can work around this bug for now by adding this line of C code to the defines section of the supplementary code window.

Code: Select all

#define TIMSK0 TIMSK

Re: Weird issue with Attiny85

Posted: Thu Dec 19, 2013 5:02 pm
by Alberta2012
Ben:

Tried to compile and it seem to work fine....will try to download tonight ! (I'm at work now , so ....)

Thanks !

Re: Weird issue with Attiny85

Posted: Mon Dec 23, 2013 3:32 am
by Alberta2012
Ben,

just wanted to confirm that your suggestion turned out to be the solution !

Thanks again !