From: Matthias T. <mt...@we...> - 2010-05-13 18:30:36
|
Hi Andy, > Looking at the quote below. > > Are we actually saying here that the top 64k is not accessible then on a > 128k device ?? > no no, the 128Kb are fully usable. No (further) restrictions are in place > That the memory is arranged in Amforth in words (ie 16 bit) ?? > It depends. The key to understand it is the concept of an address unit. One address unit provides atomic access to data. For RAM one address unit contains 1 byte. One flash address unit has 2bytes. Since amforth is a 16bit forth, there are 64K address units. That translates to 64KB RAM and 128KB Flash (separate address ranges, @ and i@ (and e@) have nothing in common). At that level there is no difference between any controller, that amforth supports. At the assembly level (where you put your hands into the dirty details) the flash has surprisingly both a 16bit and a 8bit access schema, that needs to be taken into account. And the bigger controllers need a different instruction to read the (whole) flash. The details are well hidden in the readflashcell and writeflashcell assembly macros. For the full details you'll definitly need to read the data sheets from Atmel. But I hope, that the at90can128 file is a good starting point for the atmega1281. > Or that it is paged and therefore takes a bit more time to access ?? > The flash pages are not exposed, they are used internally only. I may re-arrange the code to provide access to the pages in future releases, e.g. to implement a block device for flash that is not accessible otherwise (eg on the atmega256). The increased access time comes from the additional code needed to access the flash, but thats not that much. Only a few CPU cycles. still more confused? sorry, but be assured: the atmega128 has nothing that cannot be used with amforth and is not really slower than the smaller device types. Matthias |