Weird issue with Attiny85

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Alberta2012
Flowcode v5 User
Posts: 63
Joined: Fri Apr 19, 2013 2:18 am
Has thanked: 10 times
Been thanked: 14 times

Weird issue with Attiny85

Post 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 ?
Attachments
Block Heater Cable V2.fcf_avr
original file using the ATTiny85
(24.79 KiB) Downloaded 271 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Weird issue with Attiny85

Post 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

Alberta2012
Flowcode v5 User
Posts: 63
Joined: Fri Apr 19, 2013 2:18 am
Has thanked: 10 times
Been thanked: 14 times

Re: Weird issue with Attiny85

Post by Alberta2012 »

Ben:

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

Thanks !

Alberta2012
Flowcode v5 User
Posts: 63
Joined: Fri Apr 19, 2013 2:18 am
Has thanked: 10 times
Been thanked: 14 times

Re: Weird issue with Attiny85

Post by Alberta2012 »

Ben,

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

Thanks again !

Post Reply