3.6.1.6 Cpu Option

The -mcpu=device option should be used to specify the target device or at least a target architecture family.

For example:

xc8-cc -mcpu=atmega161 main.c

To see a list of supported devices that can be used with this option, use the -mprint-devices option (see Print-devices). The available architecture families are tabulated below.

Table 3-5. Selectable Architecture Families
Architecture Architecture Features
avr1Simple core, no data RAM, assembly support only.
avr2Classic core, up to 8 KB program memory.
avr25avr2 with movw and lpm Rx,Z[+] instructions.
avr3Classic core with up to 64 KB extended program memory.
avr31Classic core with 128 KB of program memory.
avr35avr3 with movw and lpm Rx,Z[+] instructions.
avr4Enhanced core up to 8 KB program memory.
avr5Enhanced core up to 64 KB program memory.
avr51Enhanced core 128 KB program memory.
avr6Enhanced core 256 KB program memory.
avrxmega2XMEGA core, up to 64 KB program memory, up to 64 KB data address space.
avrxmega3XMEGA core with program memory mapped into data address space.
avrxmega4XMEGA core, up to 128 KB program memory, up to 64 KB data address space.
avrxmega5XMEGA core, up to 128 KB program memory, greater than 64 KB data address space.
avrxmega6XMEGA core, greater than 128 KB program memory, up to 64 KB data address space.
avrxmega7XMEGA core, greater than 128 KB program memory, greater than 64 KB data address space.
avrtinytinyAVR core, 16 registers.