[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] The "Temporary Buffer"

From: Theodore A. Roth
Subject: Re: [avr-gcc-list] The "Temporary Buffer"
Date: Tue, 4 Dec 2001 09:44:57 -0700 (MST)

This is mostly true. It depends on whether Atmel based the flash core on 
the 29xxx or the 49xxx flash devices.

For the 29xxx, to program a page, you write a special data/address
sequence and then clock in a pages worth data (and you must give all data
for the page). The data is stored in temporary data buffer the size of the
page and the entire page is written to the flash at once. If I remember
rightly, the buffer is implemented with sram. Erasing of the page in flash
is handled by internal logic when you enter programming mode via the
special sequence.

For the 49xxx, you must first erase the page, then you can write a byte at 
a time. You still need to give a special sequence for each byte and the 

If you need to know more, check the data sheets for the 29lv512 and the 
49bv512 and compare.

As for eeprom, you write a byte, wait, write a byte, wait, etc.

The megas hide the special sequence stuff from you via the spm 

Hope this helps.

Ted Roth

On Tue, 4 Dec 2001, Christoph Plattner wrote:

:)Hello !
:)I don't know anything about the architecture of the write
:)algorism and the SPM structure, but I really think, that
:)such a buffer is implemented as a separate area in the
:)chip, not colliding to any part of RAM or ROM. But this
:)depends on the size of it.
:)Dependent on the page-size (sector size), there a flash
:)(eeprom) chips, where the user has to write without
:)interruption bytes in the programming algorithm for one
:)sector. Perhaps the buffer has the size of such one sector ...
:)Sorry, that the answer is so weak here.
:)Christoph P.
:)ken restivo wrote:
:)> Hash: SHA1
:)> I am writing a little boot loader for an ATmega163. I have 
:)> implemented a modified version of the page write routine from the data 
:)> book, in assembler. So far so good.
:)> I am concerned about the mention in the databook of a "temporary 
:)> buffer". The docs claim that the SPM instruction reads and writes a 
:)> temporary buffer.  However, a search through the docs for the text 
:)> "temporary buffer" didn't turn up any description of *what* exactly 
:)> this "temporary buffer" is, or where it is located.
:)> I have also read the AVR109 app note and looked through Atmel's 
:)> sample bootloader source code as well, with no answers found there.
:)> This worries me. For example, I may want to load more than one page 
:)> at a time of app code into RAM from my serial port, do a crc check, 
:)> etc, and only then start iteratively calling the page write routine, 
:)> but I don't want to stomp on anything inadvertently.
:)> Any ideas what/where this "temporary buffer" actually is so I can 
:)> stay out of its way?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]