Electronic – Why does AT91SAM7X microcontroller have different instruction modes

armmicrocontroller

The AT91SAM7X microcontroller has several instruction modes:

  • TDMI32bit
  • TUMB16bit
  • Jazelle8bit

Each of these modes has its own instruction code.

Why did Atmel make a 32 bit micocontroller (TDMI32bit) but make 16 bit (TUMB16bit) instructions the default?

Best Answer

The reality in microcontrollers is that code space is at a premium. Being able to reduce the size of the instructions reduces the size of code and enables packing more code into the same flash. The Thumb instruction set enables the programmer to get a lot more out of the ARM, but it has its caveats and so must be used carefully. This is because there are tradeoffs to having fewer bits and so the instruction capability is reduced. Still, a good compiler can help you utilize this feature.

Thumb2 tried to improve upon this and bridge the gap between the limits of instructions in Thumb and the ones for the 32-bit instructions.