Why does this

Sketch compile shorter on a tiny 85

//
//  FILE:  dht_test.pde  Author: Rob.Tillaart@gmail.com
//  PURPOSE: DHT library test sketch for Arduino
//  Re-PURPOSED for:  Outside DHT22 Temperature and Humidity remote radio operated
//  Modified to work with a Tiny 84 or 85 Tiny 85 and Maniacbug's RF24 class or
//  A pair of OOK 315 MHz transmitters or BlueTooth or RFM12 - 22
//  At this time (06/09/2013)... None is a requirement, what is required howevever
//  is that it fit in an 8K controller and work for 2 or 3 month's of substandard
//  solar charging on a 2800 mAH lithium cell and a 1/2 watt 6V solar cell
//
//  This code mercilessly hacked by Robert K. Johnson Sr.
//  6/09/2013 The goal here is to couple this to a Tiny 84 or 85
//  sleeping for 2 seconds and then wake up measure temp and humidity and transmmit it back

#include <dht.h>

dht DHT;

// #define DHT11_PIN 4
#define DHT22_PIN 5  // change to 11 for DHT11

void setup()
{
  Serial.begin(9600);

  Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}

void loop()
{
  // READ DATA
  Serial.print("DHT22, \t");  // change to 11 for DHT11
  int chk = DHT.read22(DHT22_PIN);  // change to 11 for DHT11

  // DISPLAY DATA
  Serial.print(DHT.humidity, 1);
  Serial.print(",\t");
  Serial.println(DHT.temperature, 1);

  //  Sensor shouldn't be checked more ofetn than once a second
  //  Use sleep to wake up every 2 seconds measure and report
  //  every 100 mS until 'ack'ed' by the receiving device

  delay(2000);  // Temp for test only replace with sleep code

}
//
// END OF FILE
//
For the Tiny
Binary sketch size: 3,746 bytes (of a 8,192 byte maximum)

Estimated used SRAM memory: 122 bytes

and

Binary sketch size: 41,304 bytes (of a 258,048 byte maximum)

Estimated used SRAM memory: 1,378 bytes (of a 8192 byte maximum)

I was really curious as I still need to put some radio stuff in the Tiny and the radio will depend on what fits…
I compiled this code by accident as a Mega 2560 and my thought was that’ll never work and then realizing my initial error wondered at the difference in size…?

Doc

Discussion I've read here is that all 4 serial ports get enabled when 1 is enabled.

Good Point, I have no Idea it never came up before, But I thought Serial defaulted to 0 and on the Mega serial is 0, serial1, ... One more thought that just occurred is that there is no serial, SoftwareSerial? isn't used either... So, Just my clumsy attempts at coding?

Doc

Coding looked fine to. Just that on Mega, you have Serial.begin(), you get the buffering setup for Serial1, Serial2, Serial3 for "free". There have been some threads on disabling what that buffer setup is.

Softwareserial, I don't know. I have added dual hardware uarts to have 6 hardware IO on a board, software serial took up too much processing time.

Binary sketch size: 41,304 bytes (of a 258,048 byte maximum)
Estimated used SRAM memory: 1,378 bytes (of a 8192 byte maximum)

Ouch!

I get this with Arduino 1.0.3…

Binary sketch size: 7,122 bytes (of a 258,048 byte maximum)

There is something else at play…

I get this with Arduino 1.5 (nightly build from about a week ago)…

Binary sketch size: 7,240 bytes (of a 258,048 byte maximum) - 2% used
Minimum Memory usage: 788 bytes

Well, Still do-able but then clearly I am using the wrong tools... Is there any other advantage to using Ver 1.5? Any disadvantages?. I don't plan to buy a Due anytime soon as there are too many other interesting offers available cheaply enough to buy and simply toss if not applicable or 'difficult'. There is also the Energia product and a couple of nice looking ST Arm boards for about the same money as an "Uno' clone. In re-considering my leading question... Is there any disadvantage to installing it (Ver 1.5.2). Is there any 'native' support for the Tiny cores, in Ver 1.5? I made a great many mistakes both in following 'best practices' both of commission and omission.. I just got the last of them straightened out yesterday and saved to a thumb drive.. I have no intention of doing that again. It has been my painful experience that "Upgrades' frequently aren't, that changing something minor can break a working environment... (was the reason I didn't play with Ver 1.02) and after 25 years of using computers from the 286 up it becomes difficult to see an upgrade as good, all too frequently they aren't. Thank You gentlemen, Bob & Coding... for your spot on and timely assistance.

Doc

Version 1.5.x is a beta IDE for support of the Due board. Version 1.0.5 is the current production version for all other arduino boards. So until they merge the IDEs I would recommend staying with 1.0.x for all non-Due boards. It’s also pretty trivial to have more then one version of the IDE installed onto your PC.

Lefty

You are welcome.

Docedison: Is there any other advantage to using Ver 1.5? Any disadvantages?

I'm neutral on the matter. I mostly use 1.0.3 (too lazy to install 1.0.5) and occasionally 1.5.nightly (anticipating better support for third-party cores).

In re-considering my leading question... Is there any disadvantage to installing it (Ver 1.5.2)?

I vaguely recall some issues with 1.5.2 that disappeared with the nightly build. Were I in your shoes I'd wait for 1.5.3.

Is there any 'native' support for the Tiny cores, in Ver 1.5?

No.

Is it hard to add your Fine Work C. B.? Your Tiny Cores?. I have really enjoyed the small cores... It's really easy to put down a 328 and a crystal and the required bypasses and the loading cap's for the crystal.. 32K is a big space especially when a piece of working code might not exceed 7 or 8 K bytes of code. It becomes a challenge to get the same code to run on an 85... and the satisfaction is directly related to the initial challenge.

Doc