Changes to port ATmega323 to ATmega128

rapurvey wrote on Wednesday, February 23, 2005:

As above.  Are any changes required?  Apart from the obvious like changing the MCU definition in the makefile.

My demo application with two tasks seems to work fine in the simulator in AVRStudio.

rtel wrote on Wednesday, February 23, 2005:

The adaptor for the STK500 that allows the use of the ATMega128 is a little prohibitive, so I have never tried it, but I know there are several people using the 128.

Here is a copy of the WEB documentation on useing a different device:

+ Change the MCU definition at the top of the makefile.

+ Set the correct clock frequency in PortMacro. h
Ensure the portTOTAL_HEAP_SIZE definition is set to fit within the available RAM.

+ The tick ISR is generated from a compare match on timer 1. Timer configuration is not identical across all AVR devices. Check the function prvSetupTimerInterrupt() in Source\portable\GCC\ATMega323\port.c to see if any modifications are required for your chosen device.

+ Whichever part is used, ensure the MCU fuses are blown to provide the correct clock frequency (this can be done from the AVR Studio development tools).

The 323 is one of the older devices and I am told that the timer and serial port register settings are a bit different on the newer versions.  You might just need to check that the timer gets setup correctly for the 128 (as mentioned above).  Having said that I got an ATMega32 (newer version of the 323) to try this out and found the code executed without any changes at all - which defeated the object of getting it!

There was once a thread that said the integer math demo tasks generated some incorrect calculation results on the 128 - but I don’t know what the resolution of this was.  The thread was never completed so I assume the author found the problem.

rapurvey wrote on Wednesday, February 23, 2005:

As I said it seems to work ok just using the 323 port in the AVRStudio simulator.  Will double check the timer configuration though.


rapurvey wrote on Thursday, March 03, 2005:

Just to confirm for anybody else looking at this thread that the timer configuration is fine and the ATmega323 port works on the ATmega128 without any changes, apart from the clock frequency.