Re: X-Mega AVRs are here!



David Kelly wrote:
David Brown wrote:

As for making it entirely von Neumann, I think that's a bit too big a change - but it would have been perfectly possible to make the flash accessible in the data space as well (in the same way as the eeprom is now mapped into the data space). You'd need 24-bit pointers to access it, but it would still be a very useful feature.

What AVR has EEPROM mapped into data space?


The XMega - at least for reading the eeprom (I haven't read the datasheets in detail).

Using lpm isn't terribly painful. No doubt motivated C compiler authors could hide the AVR FLASH constant data access mechanics, if only there was motivation.

No, you can't hide it. C only understands a single address space for data. There is no way to express ideas such as a pointer that is accessed by "lpm" instead of "ld", and there is no way to write a function with a pointer parameter which will work with both a pointer to flash and a pointer to ram. There is plenty of motivation for C compiler writers, but they are restricted by the language and by existing compiler parts (since most compilers share parts with other targets). Solutions include macro wrappers (used by avr-gcc - fully standard C, but a bit ugly), abusing the "const" keyword (used by ImageCraft, until recent versions - very clear and neat, but non-standard and causes trouble for other use of "const"), a new "flash" keyword (used by IAR - neat and clear, but non-standard), and generalised pointers (the only standards-compliant way to get full pointer functionality - but big and slow).

There are plans for introducing multiple address spaces in the next C standards, but I'm not holding my breath waiting for the implementations.
.