I had been developing some code on an ATtiny2313 but ran out of room. I have switched to an ATmega168 and just compiled the same code. The ONLY difference between the codes is a definition at the top. Here is a diff file between the two:
6,11c6,11 < #define LCD_PORT PORTC < #define LCD_DDR DDRC < #define LCD_CLK (1<<PC0) < #define LCD_SIO (1<<PC1) < #define LCD_CS (1<<PC2) < #define LCD_RST (1<<PC3) --- > #define LCD_PORT PORTB > #define LCD_DDR DDRB > #define LCD_CLK (1<<PB0) > #define LCD_SIO (1<<PB1) > #define LCD_CS (1<<PB2) > #define LCD_RST (1<<PB3)
So, when I compile this on the tiny2313 it takes up 2000 bytes. When i compile it on the mega168 it takes up 2178 bytes.
Why does the mega168 need 178 bytes more? It doesn't really matter for the application but I'm curious.