IccV7/V8 for AVR io header files FAQ


C io header files

Q: What parts are supported by io header files?
A: Basically all AVR parts and embedded AVR cores with SRAM are supported. Find full list here.

Q: If I write a >8bit USART baudrate value to register UBRR with a single instruction, only low byte is set. Device is a mega32. Is this a bug?
A: No, it's not a bug, but due to backward-compatibility with preceeding devices, which had an 8bit baudrate register only. This mainly touches the header files for mega8/16/32, mega8515/8535 and tiny2313.
Besides, for many AVRs it is not possible to setup baudrate by a single instruction at all, because low and high UBRR registers either are not contigous or not little endian (i.e. low byte at lower io address). So even if it would work in couple of cases, Atmel themselves don't use it and for XMega, even did not name UBRR registers L/H as usual, but A/B rather.
Please note, that the order of 8bit accesses to UBRR registers should be same as for other >8bit registers, i.e. high byte before low byte for standard AVRs and low byte before high byte for XMegas.

Q: Are the 'Alternative Ways of Writing Code' for XMegas supported (AppNote AVR1000, chapter 4)?
A: Yes, just '#define _alternative_ways_of_writing_code' before #include the io header file.

Q: Are the different TC0/1 structs for XMega supported (as used in Atmel XMega AppNote sources)?
A: Yes, just '#define _with_tc0_tc1_types' before #include the io header file.

Q: Are the enum data types for XMega _gc values supported (as used in Atmel XMega AppNote sources)?
A: Yes, just '#define _with_gc_enum_types' before #include the io header file.

Q: Are new tiny4/5/9/10 supported?
A: No, they are not compatible with iccavr C compiler, mainly because of missing R0..15. But asm io header file is existing and fully supported.

Q: Some latest parts are not supported by IDE. How can I use them?
A: In IDE project option set for target "Custom" and edit all entries as needed. Please note that "Text Address" is in 16bit (word) instruction rather than bytes as for all other values. To get right io header file from iccioavr.h, edit the make file and add a -D switch with your device to the CFLAGS.

Asm io header files

Q: How do I use asm io header files?
A: Just write '.include "aio<partname>.s"' in the header of your asm source file. Be sure to have '<iccv7avr install dir>\include\' in Options->Paths->Asm Include Paths.

Q: In C there is common iccioavr.h header file selecting the right io...v.h file at compile time automatically. Is similar existing for asm?
A: No chance, assembler does not support symbols defined on command line. Sorry.

Q: Do asm io header files differ from C io header files?
A: Except for ancient devices like AT90S####, mega103 and tiny22, asm files are converted from C files, so all ior addresses and bits defined in C files appear in asm header files, too. Only common differences are the (extra) memory info at the start of asm headers, and that ior addresses are for IN/OUT instructions rather than for LD/ST as in C headers. Another difference is for XMegas: In asm, structed ior addressing is not supported.

Q: I'd like to use LD/ST for io in asm...
A: Then try experimental 'aio<partname>.mm.s' files, that are available for all non-xmega parts with ior address range >0x60. To get IN/OUT addresses with those files, add '_io' suffix to ior name, e.g. 'sbic PINB_io,<bit>'. For XMegas and ATtiny4/5/9/10, IN/OUT and LD/ST addresses are identical, so there aren't .mm.s files for those devices.



(c) Copyright 2009-2010 by Johannes Assenbaum   -   last changed at Feb 18 2010