DataSheet.es    


PDF AN945 Data sheet ( Hoja de datos )

Número de pieza AN945
Descripción Software Drivers
Fabricantes STmicroelectronics 
Logotipo STmicroelectronics Logotipo



Hay una vista previa y un enlace de descarga de AN945 (archivo pdf) en la parte inferior de esta página.


Total 29 Páginas

No Preview Available ! AN945 Hoja de datos, Descripción, Manual

www.DataSheet4U.com
AN945
APPLICATION NOTE
SOFTWARE DRIVERS
for M29F040 and M29W040 FLASH MEMORIES
CONTENTS
Introduction
The M29F040
Programming Model
Modifying code from
Am29F040
Generating
SGS-THOMSON Code
C Library Functions
Adapting the Software for
the Target System
Limitations of the code
Connection to Common
Microprocessors
Conclusion
Source Code
M29F040.H
Header file for 8 bit C
Routines library
M29F040.C
8 bit C Routines library
These files may be down-
loaded from www.st.com or ob-
tained from any Sales offices
on PC compatible floppy disk.
INTRODUCTION
This application note provides library source code in C for the
M29F040 and the M29W040 Flash memories. The M29W040,
with a rated power supply of 3V, is a low voltage version of the
M29F040 whose power supply is rated at 5V. The M29W040
has slightly slower access times than the M29F040, but the two
devices are otherwise very similar. This application note sup-
ports both devices and all technical information about the
M29F040 also applies to the M29W040, except where other-
wise specified.
The application note includes listings of the source code which
is also available in file form. The m29f040.c and m29f040.h files
contain libraries for accessing both the M29F040 and the
M29W040 Flash memories.
An overview of the programming model for the M29F040 and
M29W040 is given. The programming differences between the
M29F040 and AMD’s Am29F040 are described. Advice on how
to modify programs already written for AMD’s Am29F040 device
to work with the ST device is included.
The source code is written to be as platform independent as
possible and requires minimal changes by the user in order to
compile and run. The application note explains how the user
should modify the source code for their individual target hard-
ware. All of the source code is backed up by comments explain-
ing how it is used and why it has been written as it has.
Brief hardware connections to some common microprocessors
are provided at the end of the application note to help the
designer understand the bus requirements of the M29F040 and
M29W040.
This application note does not replace the M29F040 Data
Sheet. It refers to the Data Sheet throughout and it is necessary
to have a copy in order to follow some of the explanations.
The software and accompanying documentation has been fully
tested on a target platform. It is small in size and can be applied
to any target hardware.
September 1997
1/29

1 page




AN945 pdf
AN945 - APPLICATION NOTE
www.DataSheet4U.com
GENERATING SGS-THOMSON CODE
Low-level functions (drivers) have been provided to simplify the process of developing application code in
C for the SGS-THOMSON Flash memories (M29F040 and M29W040). This enables users to concentrate
on writing the high level functions required for their particular applications. These high level funtions can
access the Flash memories by calling the low level drivers, hence keeping details of special command
sequences away from the users’ high level code: this will result in source code both simpler and easier to
maintain.
Flash memories are typically used to store source code and data in embedded systems, especially when
field updates are likely to be required; a few example applications are personal data organisers, mobile
phones or PCMCIA cards.
When developing an application, the user is advised to proceed as follows:
– First write a simple program to test the low level drivers provided and verify that these operate as expected
on the user’s target hardware and software environments.
– Then the user should write the high level code for his application, which will access the flash memories
by calling the low level drivers provided.
– Finally test the complete application source code thoroughly.
C LIBRARY FUNCTIONS
The software library provided with this application note provides the user with source code for the following
functions:
FlashReadReset() is used to reset the device into the Read Array mode. Note that there should be no
need to call this function under normal operation as all of the other software library functions leave the
device in this mode.
FlashAutoSelect() is used to identify the Manufacturer Code, Device Code and the block protection
levels of the device.
FlashBlockErase() is used to erase one or more blocks in the device. Multiple blocks will be erased
simultaneously to reduce the overall erase time. This function checks that none of the blocks specified are
protected and does not erase any blocks if some of the specified blocks are protected.
FlashChipErase() is used to erase the entire chip. It will not erase any blocks if there is a protected
block on the chip.
The functions rely on the user writing short, simple functions to read and write to the flash in their particular
target hardware.
FlashRead() must be written to read a value from the flash.
FlashWrite() must be written to write a value to the flash.
FlashPause() must be written to provide a timer with microsecond resolution. This is used to wait while
the flash recovers from some conditions.
An example of these functions is provided in the source code.
In many instances these functions can be written as macros and therefore will not incur the function call
time overhead. The two functions which perform the basic I/O to the device have been provided for users
who have awkward systems. For example where the addressing system is peculiar or the data bus has
D0..D7 of the device on D8..D15 of the microprocessor. They allow any user to quickly adapt the code to
virtually any target system.
5/29

5 Page





AN945 arduino
AN945 - APPLICATION NOTE
www.DataSheet4U.com
CONCLUSION
The M29F040 and M29W040 single voltage Flash memories are ideal products for embedded and other
computer systems, able to be easily interfaced to microprocessors and driven with simple software drivers
written in the C language.
Full product information can be found at www.st.com, queries may be sent by email to [email protected].
11/29

11 Page







PáginasTotal 29 Páginas
PDF Descargar[ Datasheet AN945.PDF ]




Hoja de datos destacado

Número de piezaDescripciónFabricantes
AN94078I2C Driver RoutinesPhilips
Philips
AN942Software DriversSTmicroelectronics
STmicroelectronics
AN943Software DriversSTmicroelectronics
STmicroelectronics
AN944Software DriversSTmicroelectronics
STmicroelectronics

Número de piezaDescripciónFabricantes
SLA6805M

High Voltage 3 phase Motor Driver IC.

Sanken
Sanken
SDC1742

12- and 14-Bit Hybrid Synchro / Resolver-to-Digital Converters.

Analog Devices
Analog Devices


DataSheet.es es una pagina web que funciona como un repositorio de manuales o hoja de datos de muchos de los productos más populares,
permitiéndote verlos en linea o descargarlos en PDF.


DataSheet.es    |   2020   |  Privacy Policy  |  Contacto  |  Buscar