beautypg.com

Write_nvds – Zilog Z8F0130 User Manual

Page 264

background image

Using the ANSI C-Compiler

UM013037-1212

240

Zilog Developer Studio II – Z8 Encore!
User Manual

Do not write to Flash memory more than twice. To write to Flash memory more than twice,
you must perform a page erase.

When you use the WRITE_FLASH function to write to Flash, the target clock frequency
must be initialized using the INIT_FLASH function (see page 230).

Beginning with the ZDS II for Z8 Encore! release 4.8, there is a slight change in the func-
tion prototype for WRITE_FLASH.

Previous Prototype

#if defined(_Z8F642)

void reentrant WRITE_FLASH(rom const void *addr,char val);

#else

void intrinsic reentrant WRITE_FLASH(rom const void *addr,char

val);

#endif

New Prototype

void reentrant WRITE_FLASH(rom const void *addr,char val);

For most Z8 Encore! microcontroller variants, the

intrinsic

keyword has been deleted

in the ZDS II release 4.8.0. This change is taken care of automatically as long as you are
using the standard Zilog library version of WRITE_FLASH and including the standard
header file

ez8.h

. However, since the new standard header uses the new prototype, if you

have customized WRITE_FLASH in your application, you must make modifications so
that the header and function declarations agree.

WRITE_NVDS

The WRITE_NVDS function is a Zilog function that writes a value to NVDS memory at
the specified address.

Synopsis

#include

reentrant int WRITE_NVDS(char value, char address)

reentrant int nvds_write(char value, char address)

Returns

If successful, the function returns zero; otherwise, it returns a nonzero value.

Example

#include

char x;

Note: