Converting a design from the 8535 to the Mega AVR 163

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am converting a design from the AVR 8535 to the Mega AVR 163. Does the software, which is written for the AVR 8535, run as well on the Mega 163?

The clock is running with 8 MHz.

The BOOTRST bit is set to 0, BOOTSZ0 and BOOTSZ1 are set to 1 and all Lock-bits are set to 1.

My problem is that the AVR 163 does not start after reset. If I program the same software into an AVR 8535 the software is working fine.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

The ATmega163 is backwards pin compatible with the AT90S8535. Everything you can do with the '8535, you can also do with the mega163. However, there are some programming differences.

The most common programming difference, is that in mega163 you must use JMP instead of RJMP. This is because the mega163 has more memory, and needs a two-cycle instruction to access it all. Further, you should re-compile with the appropriate m163def.inc file to ensure correct memory and interrupt locations.

Note that there are differences between the 8535 UART and the mega163 UART. Please confer with your datasheet on this.

If you are porting a code written for '8535, you don't have any use for the boot section. To make the device's behaviour equal to the 8535's, you must UNprogram the BOOTRST fuse. All AVR fuses are unprogrammed when '1'. You should therefore revert the value of this fuse in order to start your program at $0000. Try this first! It might solve all your problems right there!

If you're using a C compiler and the boot block, make sure that the linker file is corrected in order to accomodate this memory address change.

Morten, AVR tech. support.