I am trying to compile a sketch for the Tiny84 and receive "Serial" errors while doing so.
My set-up is:
Linux Mint 16 Laptop.
Arduino Uno R3 (as ISP)
Arduino IDE v1.6.4 - latest version.
Jeelib libraries - latest version.
OneWire libraries - latest version.
DallasTemperature - latest version.
Using the Arduino as ISP I have managed to figure out how to upload the Blinky sketch to the Tiny84. I know it works because when I power up the Tiny84 and place an LED between the Tiny pin and GND the LED blinks.
However when I try to compile the Tiny84 with the DS18B20 sketch shown here: Nathan's "TinyTX_DS18B20.ino" sketch
.. I get the following Serial errors ..
Build options changed, rebuilding all
In file included from /arduino-1.6.4/libraries/jeelib/JeeLib.h:17:0,
from USBISP-tiny84_DS18B20.ino:16:
/arduino-1.6.4/libraries/jeelib/Ports.h:713:49: error: 'Serial' was not declared in this scope
InputParser (byte size, Commands*, Stream& =Serial); ^
/arduino-1.6.4/libraries/jeelib/Ports.h:714:60: error: 'Serial' was not declared in this scope
InputParser (byte* buf, byte size, Commands*, Stream& =Serial); ^
Error compiling.
The error seems to be something to do with Serial, which I don't think the Tiny84 has?
(Not sure what it's capability with serial is).
I have tried some changes to
OneWire.h
pins_arduino.h
Ports.h
as seen in some posts but I am now in a bit of a muddle.
Perhaps I did not understand the posts or the library /IDE software has changed making previous posted recommended changes - to get it working - redundant.
I don't really know C programming language.
Can anyone help pls with configuration changes to make and where?
Build options changed, rebuilding all
/arduino-1.6.4/libraries/jeelib/RF12.cpp: In function 'void rf12_configDump()':
/arduino-1.6.4/libraries/jeelib/RF12.cpp:752:5: error: 'Serial' was not declared in this scope
Serial.print(' ');
^
Error compiling
I then tried deleting the following section in RF12.cpp
/// @details
/// This replaces rf12_config(0), to be called after rf12_configSilent(). Can be
/// used to avoid pulling in the Serial port code in cases where it's not used.
IMO, you should talk to the jeelib people, because they CLEARLY INTENDED TO SUPPORT TINY84/85 - like there are #ifdefs elsewhere in the same files looking for 84 and 85...
Just commenting out the offending lines is not going to be successful, because those lines weren't just there for looks, they did something (I have no idea what, frankly - that library is complicated). The library authors are better placed to provide insight or solution here.
.. and done some reading on the jeelabs.org web.
A search there on "tiny84" and nothing springs out.
I think they call their tiny84 "board+chip+RFM12B" the "Jeenode micro."
.. anyways ..
I've also downloaded and tried:
Arduino IDE 1.6.5 Hourly Build 2015/06/08 4:31.
There was some suggestion (while reading) on jeelabs.org that the latest Arduino IDE supplied better built in support for the tiny84. However I get exactly same errors as described above while using this.
I downloaded your tiny core, Coding Badly's Tiny Core.
Using this tiny core the "Serial" errors have gone away.
These have been replaced by new errors as follows:
In file included from /arduino-1.6.4/libraries/OneWire/OneWire.h:7:0,
from USBISP-tiny84_DS18B20.ino:14:
USBISP-tiny84_DS18B20.ino: In function 'long int readVcc()':
USBISP-tiny84_DS18B20:95: error: 'PRR' was not declared in this scope
/arduino-1.6.4/hardware/arduino/avr/cores/arduino/Arduino.h:105:32: note: in definition of macro 'bitClear' #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
^
USBISP-tiny84_DS18B20.ino: In function 'void setup()':
USBISP-tiny84_DS18B20:121: error: 'PRR' was not declared in this scope
'PRR' was not declared in this scope
If I then comment out the 4 below lines, in Nathan's "TinyTX_DS18B20.ino" sketch, all errors go away, and it compiles! (The lines are shown in the order in which I removed them for successful compilation, top line first).
I doubt removing these lines is desirable.
It looks like the lines are to do with battery power saving(?), though I'm not sure how they connect with any other lines.
line 121: PRR = bit(PRTIM1); // only keep timer 0 going
line 123: ADCSRA &= ~ bit(ADEN); bitSet(PRR, PRADC); // Disable the ADC to save power
line 95: bitClear(PRR, PRADC); ADCSRA |= bit(ADEN); // Enable the ADC
line 109: ADCSRA &= ~ bit(ADEN); bitSet(PRR, PRADC); // Disable the ADC to save power
I just downloaded the sketch and the three libraries then verified using ATtiny84 @ 8 MHz...
Sketch uses 7,082 bytes (86%) of program storage space. Maximum is 8,192 bytes.
Global variables use 173 bytes (33%) of dynamic memory, leaving 339 bytes for local variables. Maximum is 512 bytes.
I suspect you have something not installed correctly or introduced a problem in trying to get the sketch to compile. The simplest solution is very likely to remove everything and start over.
Done Compiling.
Third-party platform.txt does not define compiler.path. Please report this to the third-party hardware maintainer.
Build options changed, rebuilding all
Sketch uses 7,082 bytes (86%) of program storage space. Maximum is 8,192 bytes.
Global variables use 173 bytes (33%) of dynamic memory, leaving 339 bytes for local variables. Maximum is 512 bytes.
I do not know if the error "Third-party platform.txt does not define compiler.path" has any impact?
Done Compiling.
Build options changed, rebuilding all
Sketch uses 7,082 bytes (86%) of program storage space. Maximum is 8,192 bytes.
Global variables use 173 bytes (33%) of dynamic memory, leaving 339 bytes for local variables. Maximum is 512 bytes.
It compiles successfully.
Thanks for the help and the tiny core
The tiny84 chip is now 'flashed' with Nathan's DS18B20 sketch.
Now to figure out how to use this Tiny84+RFM12B as TX, and the RFM12B+Rasp-Pi as RX.
After that the journey will move to RFM69CW, which has slightly higher power and encryption.
Now that the sketch compiles I will sit and have a think as to why getting this going was not easy. In hindsight it's always easy once you are there (what ever 'it' is). You (thats me in the third person) think : why was that so difficult. I think there are and were many variables, and as you suggest, a small (untoward) tweak had been introduced into the libraries, hence the need to have a refresh.