[CCC DEV] Arduino MEGA support question

Adam Sampson ats at offog.org
Tue Jun 15 18:25:01 BST 2010


Matt Jadud <jadudm at gmail.com> writes:

> 1. Add some flags to the Arduino wrapper [...]
> 2. Split support libraries out [...]

Sounds reasonable. Is there a naming scheme for Arduino variants
elsewhere that we could reuse (e.g. in the Arduino tree)?

> 3. Virtual memory support -- the Mega has 128K+ of flash, implying our
> read_mem interface needs to be updated (I think?)

Depends on how much of that 128K you want to use. At the moment, the
Transterpreter is emulating a T2, which is a 16-bit Transputer -- so it
only has 16-bit addressing, meaning that the whole address space can
only be 64K. At the moment, we split the memory space half-half between
RAM and Flash, so it only exposes 32K of Flash; it would be easy to move
the split to expose 8K of RAM and 56K of Flash, though.

If you need more than that, it starts getting complicated, since
pointers on the AVR are also only 16 bits, and the rest of the Flash is
accessed by page-switching (loading registers to say which 64K chunk you
want to address). You could easily enough implement a way of switching
between several completely different programs by loading the page
registers on startup, but making the memory properly addressable would
be trickier -- you'd need to emulate a 32-bit Transputer, which would be
quite a bit of work. (And I'm not entirely sure whether AVR-GCC has the
larger Flash pointers that IAC supports...)

> Sent from my TRS-80

Fantastic. :) Sadly I've just packed up my BBC Micro...

-- 
Adam Sampson <ats at offog.org>                         <http://offog.org/>




More information about the developers mailing list