Re: X-Mega AVRs are here!
- From: John Devereux <jdREMOVE@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 03 Mar 2008 16:46:13 +0000
David Brown <david@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:
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.
Exactly right, and in the end that was the downfall of the AVR for
me. That's why I don't really see the point of these new big
devices. As the memories get bigger and the I/O more capable, the core
must be taking up proportionally less and less area. So why not go for
a 32 bitter and be done with it?
--
John Devereux
.
- Follow-Ups:
- Re: X-Mega AVRs are here!
- From: Ulf Samuelsson
- Re: X-Mega AVRs are here!
- References:
- Re: X-Mega AVRs are here!
- From: David Kelly
- Re: X-Mega AVRs are here!
- From: David Brown
- Re: X-Mega AVRs are here!
- Prev by Date: Re: Designing a protocol for the first time
- Next by Date: AVRStudio and C under W98?possible?
- Previous by thread: Re: X-Mega AVRs are here!
- Next by thread: Re: X-Mega AVRs are here!
- Index(es):