hey
i am new over here and i have the new duemilanove board with atmega 328. i wanted to know if i can use a code written for atmega128 on the at328 directly?? ofcourse i'll see to the pinout changes as both boards r having different pinouts. but are rest of the registers same??
The standard release of the Arduino core files do not have full support for the 128.
My extras version does, check out http://www.arduino-avr.com
You need to be aware that the pin # to port/bit mapping may not be correct for your board. Which board are you using?
Mark
i will be making my own board and then i will be using a usb programmer to burn.
can [I] use a code written for atmega128 on the at328 directly??
Did you mean 128 or 168? The ATmega128 is a 64pin micro with 128K of flash memory and 4K of RAM. The ATmega328 has 28 pins, 32k of flash, and 2K of RAM. Very basic programs written for (say) a development board that happened to use a 128, but not making use of most of the resources, MIGHT be pretty easy to port to a mega328. Applications that make nearly full use of the mega128 would not stand a chance.
The ATmega168 is just a smaller-memory version of the ATmega328. Programs written for a 168 would run fine on a 328.
i am talking about atmega128. i just wanted to know if 128 and 328 are code compatible. because i have duemilanove with 328 and i am making another board with 128(using mainly due to its memory).
anyways iwent through the datasheet and registers are different
328 has tccr0a and tccr0b whereas 128 has tccr0 . so i will have to change pinouts and registers also in the code!!!
The binary code is not compatible. You have to re-compile for specifying the CPU you are using.
No the registers are not the same. They have different timers, the 128 can support external RAM and the 128 has more ports.
Mark