Weird issue with Attiny85
Posted: Thu Dec 19, 2013 1:56 am
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 ?
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 ?