EasyManua.ls Logo

Rabbit 2000 - Page 40

Rabbit 2000
45 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
38 Rabbit
2000
Microprocessor
_WriteFlash
This
function
writes
exactly
one
sector
of
data
from
a
buffer
in
RAM
to
the
flash
mem-
ory.
It
is
called
from
the
BIOS
as
well
as
several
libraries,
and
should
be
written
to
con-
form
to
the
following
requirements:
It
should
assume
that
the
source
data
is
located
at
the
logical
RAM
address
passed
in
HL.
It
should
assume
that
the
flash
address
to
be
written
to
is
passed
as
an
XMEM
address
in
A:DE.
The
destination
must
be
aligned
with
a
flash
memory
sector
boundary.
It
should
check
to
see
whether
the
sector
being
written
to
is
an
ID
block.
If
so,
it
should
exit
with
an
error
code
(see
below).
Otherwise,
it
should
perform
the
actual
write
oper-
ation
required
by
the
particular
flash
used.
Interrupts
should
be
turned
off
(set
the
interrupt
level
to
3)
whenever
writes
are
occur-
ring
to
the
flash.
Interrupts
should
not
be
turned
back
on
until
the
write
is
complete
--
an
interrupt
may
attempt
to
access
a
function
in
flash
while
the
write
is
occurring
and
fail.
It
should
not
return
until
the
write
operation
is
finished
on
the
chip.
It
should
return
a
zero
in
HL
if
the
operation
was
successful,
a
-3
if
a
timeout
occurred
during
the
wait,
or
a
-4
if
an
attempt
was
made
to
write
over
the
ID
block.
Modifications
to
Dyncamic
C
are
pending
to
allow
use
of
large
sector
(>4096)
flashes
in
debugging.
To
incorporate
a
large
sectored
flash
into
an
end
product,
the
best
strategy
is
have
a
small
sectored
development
board.

Other manuals for Rabbit 2000