hello forum,
I am new to programming in AVR, i saw different chips of atmega and attiny working on ISP technology, I want to know that if I create a hex file for any atmega ic, will it also work on attiny ic ? ( i will be changing the port names according to configuration for atmega and attiny)
Regards
Goyaam
goyaam:
if I create a hex file for any atmega ic, will it also work on attiny ic ?
No, the hex is device specific (so isn't only a problem between ATmega and ATtiny but all). Exception is with some types which only differ in memory size.
goyaam:
i will be changing the port names according to configuration for atmega and attiny)
How are you planning to do that in a hex?
If you mean, can I use the same C/C++ code on a ATmega or ATtiny than it's a different story. As long as your program doesn't use (non standard) hardware specific peripherals you can use the same code (with changed pins) as long as you also gave the IDE support for the ATtiny you use. But the key here is hardware specific peripherals. For example, the normal Servo library does not work on a ATTiny because it's lacking a 16-bit timer1.
septillion:
For example, the normal Servo library does not work on a ATTiny because it's lacking a 16-bit timer1.
Only attiny x5, x61. The other attinys have a 16bit timer1
Alright, I meant ATtiny85*. But my point is the same, hardware specific code (aka code that does direct register manipulation) might not be portable.
- On those other ATTiny's, are the Timer 1 registers the same?