DataSheet.es    


PDF AN943 Data sheet ( Hoja de datos )

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



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


Total 30 Páginas

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

www.DataSheet4U.com
AN943
APPLICATION NOTE
SOFTWARE DRIVERS
for M29F400 and M29W400 FLASH MEMORIES
CONTENTS
Introduction
The M29F400
Programming Model
Modifying code from
Am29F400
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
M29F400A.H
Header file for 16 bit C
Routines library
M29F400A.C
16 bit C Routines library
M29F400B.H
Header file for 8 bit C
Routines library
M29F400B.C
8 bit C Routines library
These files may be down-
loaded from www.st.com or
obtained from any Sales of-
fices on PC compatible floppy
disk.
December 1997
INTRODUCTION
This application note provides library source code in C for the
M29F400 and the M29W400 Flash memories. The M29W400,
with a rated power supply of 3V, is a low voltage version of the
M29F400 whose power supply is rated at 5V. The M29W400
has slightly slower access times than the M29F400, but the two
devices are otherwise very similar. This application note sup-
ports both devices and all technical information about the
M29F400 also applies to the M29W400, except where other-
wise specified. There are two different M29F400 parts, the
M29F400B and M29F400T, which will be referred to generically
as the M29F400. Similarly the term M29W400 in this application
note can refer to either the M29W400T or the M29W400B.
The application note includes listings of the source code which
is also available in file form. The m29f400a files contain libraries
for accessing the M29F400 and the M29W400 Flash memories
in 16-bit bus mode, whereas the m29f400b files contain the 8-bit
drivers for these devices.
An overview of the programming model for the M29F400 (and
M29W400) is given. The programming differences between the
M29F400 and AMD’s Am29F400Aare described. Advice on how
to modify programs already written for AMD’s 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 M29F400 and
the M29W400.
This application note does not replace the M29F400 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.
1/50

1 page




AN943 pdf
AN943 - APPLICATION NOTE
www.DataSheet4U.com
In order to hide the difference between the M29F400 and the Am29F400A from the user’s source code the
function could be changed to the following:
unsigned int device_code( void )
{
/* Write auto select sequence */
FlashWrite( 0x5555L, 0x00AA );
FlashWrite( 0x2AAAL, 0x0055 );
FlashWrite( 0x5555L, 0x0090 );
/* Check for ST */
if( FlashRead(0x0000L) == 0x0020 )
{
if( FlashRead(0x0001L) == 0x00D5 )
return 0x2223;
if( FlashRead(0x0001L) == 0x00D6 )
return 0x22AB;
if( FlashRead(0x0001L) == 0x00EE )
return 0x22B9;
if( FlashRead(0x0001L) == 0x00EF )
return 0x22BA; }
/* Read Device Code */
return FlashRead( 0x0001L );
}
A similar condition will need to be put in any functions which read the manufacturer code to ensure that
the algorithms identify the device as an AMD part. No other changes to the algorithms will be necessary
due to the compatibility of ST and AMD devices.
Referring back to the modified version of the example function ‘device code’ above, it will be clear that
higher level functions cannot differentiate between the Am29F400AT and the M29F400T from the return
value of ‘device_code’. For applications, such as flash programmers, which need to distinguish between
SGS-THOMSON and AMD parts, the original version of the ’device_code’ function must be retained. In
this case, higher level functions which rely on the return value of ‘device_code’ must be modified to
recognise the SGS-THOMSON parts.
If the user is developing a new software to support the AMD Am29F400B as well as the ST M29F400 or
the original AMD Am29F400A, he should be aware that AMD, changing revision of their product, have also
changed the number of address bits specified in the coded cycle during the write operations.
When writing command sequences to the ST M29F400 or the Am29F400A, the address lines A11 to A14
need to be set correctly, while A15 to A17 can be set to any value whereas for the AMD Am29F400B the
address lines A11 to A17 can be set to any value.
The source code in this application note will work with any of the parts, including the Am29F400B. However,
care should be taken when fitting an M29F400 in place of an Am29F400B: address bits A11 to A14 must
be set to the appropriate value during coded cycles. This practically means that the address value must
be set as per product datasheet on 4 hexadecimal digits for the M29F400.
5/50

5 Page





AN943 arduino
AN943 - APPLICATION NOTE
www.DataSheet4U.com
following the falling edge of DEN. G should be kept asserted for two cycles of CLK2: it is set High at the
second rising edge of CLK2.
The i80960SA indicates a write cycle by driving DT/R High. During the write cycle the rising edge of W on
the M29F400 controls latching of the data. The DEN output of the i80960SA cannot be used directly for
this purpose as its rising edge occurs when data is removed from the bus. Instead the W input of the
M29F400 is asserted on the rising edge of CLK2 following the falling edge of DEN. Then, in order to latch
the data, W is set High on the following rising edge of CLK2.
Connection to the MC68331
The MC68331 has a non-multiplexed 16-bit data bus; however the example in Figure 3 shows the
configuration for byte-wide access purely to illustrate the byte-wide mode of the M29W400.
The Motorola standard for reading bytes on a 16-bit bus is to access the byte on the upper data lines,
hence D0 of the M29W400 is connected to D8 of the MC68331, with the other data lines following.
The MC68331 has eleven chip selects, one of which can readily be used to select the M29W400 device.
Furthermore during a write cycle the data is held on the data bus for 15ns following the rising edge of CS1,
which can thus be used to latch the data into the M29W400.
The MC68331 provides one output to indicate either a read or a write. An inverter is required to transform
this for the output enable G pin of the M29W400. During the read cycle the MC68331 does not require the
data to be held after CS1 goes high, allowing the M29W400 E input to be driven directly from CS1.
Figure 3. Connection of the M29F400 and M29W400 to the MC68330
D8-D15
A0-A18
MC68330
R/W
CS1
Data Bus
Address Bus
D0-D7
A–1-A17
M29F400
G M29W400
W
BYTE
VSS
E
AI02163
11/50

11 Page







PáginasTotal 30 Páginas
PDF Descargar[ Datasheet AN943.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