The ST7FLITE0 extends the lower end of the ST7 range, designed to fit applications with
state-of-the-art features in a very small package.
ST7FLITE0 8-bi t MCUs have man y cost-sa ving features and they come w ith low-cost tool s,
providing a complete package to reduce both design and final appl ication costs to the absolute
minimum.
This application note highlights some small but very important aspects of the ST7FLITE0 that
users should not overlook when reading the datasheet.
Sections 2 and 3 contain helpful pointers and a table to help you star t working with ST7FLITE0
and its related tools.
Table 1. ST7Lite0 Features
Program memory
RAM
Data EEPROM
Package
Number of I/O pi ns
Vdd ra nge
Temperature range
IDDmax in RUN mode
LVD
Clock sources
A/D
Timers
Communication peripheral
Special features
1.5
Kbytes Flash (single voltage)
128 bytes
ST7FLITE05: no Data EEPROM
ST7FLITE09: 128 bytes Data EEPROM
SO16 (.150) or DIP16
13 (including 6 high current pins)
The ST7FLITE0 is a small low-cost microcontroller, embedding many analog functions. It
therefore allows you to save board area and the cost of external components. There is no
need for:
- external ceramic resonator for accurate oscillators (see 3.2)
2
- external E
- external reset circ uitry
- external LVD circuitry
- PCB rework for SW update
- large PCB
1.2 AREA OPTIMIZATION
data (see 3.4)
ST7FLITE0 gives you the choice of two small 16-p in packa ges. Yo u can take adva ntage of
this to save area on your PCB.
SO16: 6x9.9mm DIP16:10.92x19.18mm
ST7FLITE0 actual-size footprint of 16-Pin SO Package - Typical: 6mm wide, 9.9mm long
3/26
ST7FLITE0 QUICK REFERENCE NOTE
1.3 HIGH ACCURACY INTERNAL 1MHZ RC OSCILLATOR
The ST7Fl ite0 con tains a n i nter nal RC osc illator with a n a ccur acy of 1% for a give n d evice,
temperature and voltage. It must be calibrated to obtain the frequency required in the application. This is done by software writing a calibration value in the RCCR (RC Control Register).
Whenever the ST7FLITE0 microcontroller is reset, the RCCR returns to its default value
(FFh), i.e. each time the device is reset, the calibration value must be loaded in the RCCR.
2
Predefined calibration values are stored in E
PROM for 3.0 and 5V VDD suppl y voltages at
25°C, as shown in the following table.
RCCRConditions
V
=5V
DD
=25°C
T
RCCR0
RCCR1
A
fRC =1MHz
V
=3V
DD
T
=25°C
A
fRC =700kHz
ST7FLITE09
Address
1000h and
FFDEh
1001h and
FFDFh
ST7FLITE05
Address
FFDEh
FFDFh
If the voltage or temperature conditions change in the application, the frequency may need to
be recalibrated.
Refer to AN1324 “Calibrating The RC Oscillator of the ST7FLITE0 MCU using the Mains
”
for information on how to calibrate the RC frequency using an external reference signal.
Decoupling capacitor f or stab le oscillator
Vdd and Gnd levels impact the stability of the 1% internal RC of the ST7FLITE0. To reach the
most stable oscillation, use decoupling capacitors between Vdd and Gnd pins, at values recommended in the datasheet.
RCCR calibration locations can be W rite Protected
The STVP or InDART tools allow you to prevent uni ntentional write acc ess to the RCCR cali-
bration locations.
1.4 8-BIT A/D CONVERTER WITH INPUT VOLTAGE AMPLIFIER (X8)
The 8-bit A/D converter allows up to 5 channels with multiplexed inputs.
You can take advantage of its internal fixed-gain amplifier (x8) for zooming on low voltage in-
puts. For Vd d=5V , the AD C can the refore c onver t from 0V to 250mV . In this case the ADC
ideal resolution is 2.4mV, equivalent to a 11-bit resolution with input range from 0V to Vdd.
4/26
ST7FLITE0 QUICK REFERENCE NOTE
1.5 TRUE E2PROM DATA
The ST7FLITE09 contains an Electrically Erasable Programmable Read-Only Memory which
can be used as a non volatile back-up for storing data. It allows up to 300K Write/Erase cycles
at 25°C.
Main Features
- Up to 32 Bytes programmed in the same cycle
- mono-voltage EEPROM (charge pump)
- Chained erase and programming cycles
- Internal control of the global programming cycle duration
- WAIT mode management
- Read-out protection against piracy
Useful Tips:ST7FLITE05: Emulate Data E2PROM wit h p rogram area
For devices with no Data E2PROM, you can emulate Data EEPR OM
with the XFlash Memory.
For more information, refer to:
AN1477: Emulated Data EEP ROM with XFlash memory
1.6 SAFE PROTECTION AGAINST PIRACY ON DATA E2PROM AND FLASH
2
Data stored in the E
PROM memory, as well as the pr ogram memo ry, are protected against
read-out piracy. This is managed by the option bit “Read-out protection”. Removing this option
by erasing the option byte will cause the whole memory to be erased first.
Flash program mem ory can also be protected aga inst re-w rite opera tion by opti on bit “Flash
Write protection”. When this option is selected, the program memory can never be erased or
programmed again.
5/26
ST7FLITE0 QUICK REFERENCE NOTE
1.7 IN-C IRCUI T PROGR AMMING AN D IN- APPLICAT ION P ROGRAMMING CAPABI LITIES
In addition to using a programming tool, the two follow ing modes allow you to program your
ST7LITE0 without removing it from your PCB.
ICP: In-Circuit-Programming: The ICP is the ability to program the Flash memory (FLASH sectors 0 and 1, option byte row and data EEPROM) of a microcontroller using ICC (In-Circuit
Communication) protocol while the device is already plugged-in to the application, but application is not running.
IAP: In-Application-Pro gramm ing: The IAP is the ability to re-progra m the FLAS H memor y
(FLASH sector 1 and data EEPROM) of a microcontroller while the device is al ready pl uggedin to the application and the application is running. As sector 0 contains the software driver to
be able to re-program, it is write protected, therefore not reprogrammable.
In ICP minimum configuration, only 3 wires are needed (ICCCLK, ICCDATA, RESET
user may also use it as a basis to develop its own debugging tool.
Programm ing time:
ICP allows 1kbytes to be programmed/erased in 160ms.
Typical measurements: 1.5k Flash programming time: 315ms
For more information, refer to the Programming Manuals:
. ST7 Flash Programming Reference Manual
. ST7 ICC Protocol Reference Manual
Useful Tips:Sector 0 size configurable by Option Byte
As sector 0 is not re-programmable in IAP programming mode, you
may take advantage of configuring its size to optimize Program
Memory.
By Option Byte, sector 0 size can be set at 0.5 Kbytes, 1 Kbytes, or 1.5
Kbytes.
). The
6/26
ST7FLITE0 QUICK REFERENCE NOTE
2 ST7LITE0 DEVEL OPMENT TOOLS
Table 2 shows a summary of available tools for each function.
Table 2. Available Tools
DEBUG
SIMULATEEMULATE
&
PROGRAM
STVD7
Simulator
SOFTWARE
no needST7MDT10-EMU3 ST7FLITE0-INDARTno needST7MDT10-EPB
HARDWARE
STVD7STVD7 (included in
ST7FLITE0-INDART
package)
GRAPHIC
DESIGN &
PROGRAM
DEBUG
ST-REALIZERIISTVP7
Note: Third-party C-compiler tool chains can be used with STVD7 interface.
2.1 SOFTWARE TOOLS
2.1.1 ST7 Visual Debug IDE - Reference: STVD7
Visual interface for C or Assembler coding, compile, download and debug with ST7 Emulators
or ST7FLITE0-INDART.
Web: http://mcu.st.com
ST7
2.1.2 STVD7 Simulator
Stand-alone tool whi ch al lows to wr ite code, c ompi le, and simul ate an ST 7FLITE0 w ith your
PC your ST7FLITE0.
Web: http://mcu.st.com
ST7
2.1.3 C Compiler toolchains from Cosmic and M etrowerks
- Free evaluation version limited to 1K
- Low-cost lite C compiler limited to 8K
This compilers can be embedded in STVD7 IDE interface, or used through dedicated graph-
ST7FLITE0-INDART includes a full-featured experiment board, an in-circuit programming
utility, and all tools required to develop custom embedded applications, at low cost. 100% of
electrical characteristics are guaranteed by use of a standard chip, not bondout chip.
ST7FLITE0-INDART contains STVD7 graphical interface, C compiler and assembl er.
Debugging capabilit ies: Real-time emulation, breakpoints, step capabilities , read/write
memory and registers.
2
Programming capabilities: Blank-check, Program, Read, Verify Flash, E
PROM memory and
Option Bytes.
Notes:
1. It can be ordered from ST, or directly from Softec. Softec reference: inDART-ST7FLITE0
2. No power supply is delivered with this kit. A typical 5V may be used.
Web: http://www.softecmicro.com/indart-st7flite0.html
e-mail: info@softecmicro.com
2.2.2 ST Emulator - Reference: ST7MDT10-EMU3
Advanced development tool including:
- Real-time emulator (Advanced breakpoints management (through Bus Event Machine),
256K real-time trace recording, read/write on the fly through Watch and Memory windows,
Performance analysis)
- STVD7 User Interface
- Set of probes for Lite family packages.
- Parallel interface cable to PC
- Power Supply
Note: the ST Emulator cannot program parts. Therefore, a separate devic e programmer is r e-
quired (as ST7 Programming tool (see 4.2.3))
Web: http://mcu.st.com
ST7
8/26
ST7FLITE0 QUICK REFERENCE NOTE
2.2.3 ST Programming tool - Reference: ST7MDT10-EPB
2
Main features: Blank-check, Program, Read, Verify Flash, E
PROM memory and Option
Bytes.
ICP programming mode is supported. All Lite0 packages included.
This is done through STVP7: ST7 Visual Programmer. Visual Interface allowing to program
2
Flash, Data E
Web: http://mcu.st.com
PROM, and option bytes.
ST7
2.2.4 ST Graphic Design and Debu g - Reference: STREALIZER- II
The ST Realizer allows you to graphically design applications for the ST7 microcontroller
family, without any prerequisite knowledge in assembler program ming. With a single click,
using the powerful graphics editor and compiler, you can generate complete software applications for the ST7FLite0.
Main features: schematic-based Design, Analysis, Simulator for debugging
Web: http://mcu.st.com
ST7
9/26
ST7FLITE0 QUICK REFERENCE NOTE
3 START TODAY
1) Go to ST's website (http://mcu.st.com) and download:
– STVD7 software
and these items:
– ASM/LYN software
– C osmic C compiler Demo software
– Metrowerks C compiler software
– ST Visual Programmer
2) Install all software and follow “Getting Started” in STVD7.
3) Copy certain files for the “Getting Started” example and create your own project in STVD7.
4) Order tools:
– EMU - ST's or inDART
– EPB
– C compiler - Cosmic or Metrowerks
Operating Supply2.4 V to 5.5 V
CPU Frequency1 MHz RC 1% PLL x4/8MHz
Operating Tempera-
ture
Table 4. Pin Chart
PinNameMain FunctionAlternate Function
1.5K FLASH1.5K FLASH
128-
Lite Timer w/ Watchdog, Autore-
load Timer w/ 1
PWM, SPI, 8-bit ADC w/ Op-Amp
-40 C to +85 C (-40 C to +105/125
C Optional)
1V
2V
SS
DD
3RESET
4SS
/AIN0/PB0PORT B0ADC Analog Input 0 or SPI Slave Select (active low)
Ground
Main Power Supply
Top-Priority Non Maskable Interrupt (active low)
5SCK/AIN1/PB1PORT B1ADC Analog Input 1 or SPI Serial Clock
6MISO/AIN2/PB2PORT B2ADC Analog Input 2 or SPI Master In/Slave Out Data
7MOSI/AIN3/PB3PORT B3ADC Analog Input 3 or SPI Master Out/Slave In Data
8CLKIN/AIN4/PB4PORT B4ADC Analog Input 4 or External Clock Input
9PA7PORT A7
10PA6 /MCO/ICCCLKPORT A6Main Clock Output or In-Circuit Communication Clock
11PA5 (HS)/ICCDATAPORT A5In-Circuit Communication Data
12PA4 (HS)PORT A4
13PA3 (HS)PORT A3
14PA2 (HS)/ATPWM0PORT A2Auto-Reload Timer PWM0
15PA1 (HS)PORT A1
16PA0 (HS)/LTICPORT A0Lite Timer Input Capture
11/26
ST7FLITE0 QUICK REFERENCE NOTE
Table 5. Instruction Set
MnemonicDescriptionOperationDest.SourceFlags
ADC d, sAdd with carry, s to dd ⇐ d + s + CAmemH, N, Z, C
⇐
ADD d, sAdd s to dd
AND d, sLogical AND (d with s)d
BCP s, dBit compare A, mem{N, Z}
BRES d, bBit reset dd
BSET d, bBit set dd
BTJF d, b, rel Jump if bit is false (0)PC
BTJT d, b, rel Jump if bit is true (1)PC
CALL dCall subroutinePUSH (PC + length); PC
CALLR dCall subroutine relativePUSH (PC + length); PC
DEC dDecrement dd
HALTHaltI
INC dIncrement dd
IRETInterrupt routine returnPOP CC, A, X, PC--H, I, N, Z , C
d + sAmemH, N, Z, C
⇐
d AND sAmemN, Z
⇐
s AND dAmemN, Z
⇐
d AND (2b)mem--
⇐
d OR (2b)mem--
⇐
PC + rel IF (d AND (2b)) = 0mem-C
⇐
PC + rel IF (d AND (2b)) ≠ 0mem -C
⇐
dmem--
⇐
PC + dmem--
⇐
0
⇐
TEST (d - s)regmemN, Z, C
⇐
d XOR FFh
⇐
d - 1
⇐
0--I = 0
⇐
d + 1
reg,
mem
reg,
mem
reg,
mem
reg,
mem
-N = 0, Z = 1
-N, Z, C = 1
-N, Z
-N, Z
⇐
JP dAbsolute jumpPC
JRA dJump relative alwaysPC
JRT dJump relative if trueP C
JRF dNever jump-mem-JRIH dJump Relative if Port INT pin = 1 PC
JRIL dJump Relative if Port INT pin = 0 PC
JRH dJump Relative if H = 1PC
JRNH dJump Rela t i ve if H = 0PC
JRM dJump Rela tive if I = 1PC
JRNM dJump Relative if I = 0PC
JRMI dJump Relative if N = 1PC
JRPL dJump Relative if N = 0PC
JREQ dJump Relative if Z = 1PC
JRNE dJump Relative if Z = 0PC
12/26
dmem--
⇐
PC + dmem--
⇐
PC + dmem--
⇐
PC + d IF interrupt line highmem--
⇐
PC + d IF interrupt line lowmem--
⇐
PC + d IF H = 1mem--
⇐
PC + d IF H = 0mem--
⇐
PC + d IF I = 1me m--
⇐
PC + d IF I = 0me m--
⇐
PC + d IF N = 1mem--
⇐
PC + d IF N = 0mem--
⇐
PC + d IF Z = 1mem--
⇐
PC + d IF Z = 0mem--
ST7FLITE0 QUICK REFERENCE NOTE
Table 5. Instruction Set
MnemonicDescriptionOperationDest.SourceFlags
JRC dJump Relative if C = 1PC ⇐ PC + d IF C = 1mem--
⇐
JRNC dJump Rela t i ve if C = 0PC
JRULT dJump Relative if C = 1PC
JRUG E dJump Relative if C = 0PC
JRUGT dJump Relative if (C + Z) = 0PC
JRULE dJump Rela tive if (C + Z) = 1PC
LD d, sLoad s in dd
MUL d, sMultiply d by sd:s
NEG dNegate d (logical 2-complement) d
NOPNo operation----
OR d, sLogical OR (d with s)d
POP dPop from the Stackd
PC + d IF C = 0mem--
⇐
PC + d IF C = 1mem--
⇐
PC + d IF C = 0mem--
⇐
PC + d IF (C OR Z) = 1mem--
⇐
PC + d IF (C OR Z) = 0mem--
⇐
s
⇐
d * sA, X, YA, X, Y H = 0, C = 0
⇐
(d XOR FFh) + 1
⇐
d OR sAmemN, Z
⇐
(++SP)reg, CC -H, I, N, Z, C
reg,
mem
reg,
mem
mem,
reg
-N, Z, C
N, Z
⇐
PUSH dPush onto the Stack(SP- -)
RCFReset carry flagC
d-reg, CC-
⇐
0--C = 0
RETSubroutine returnPOP PC---
⇐
RIMReset interrupt maskI
RLC dRotate left through carry
RRC dRotate right through carry
RSPReset Stack pointerSP
SBC d, sSubtract s from d with carryd
SCFSet carry flagC
SIMSet interrupt maskI
SLA d
Shift left arithmetic (equal to SLL
1)
SLL dShift left logical
SRA d
Shift right arithmetic (equal to
SRL 1)
SRL dShift right logical
SUB d, sSubtract s from dd
SWAP dSwap nibblesd (7:4)
TNZ dTest for negative and zero{N, Z}
0--I = 0
C ← 70
C→70
⇐
reset value---
⇐
d - s - CAmemN, Z, C
⇐
1--C = 1
⇐
1--I = 1
C←70←0
C←70←0
70→0
0→70→C
⇐
d - sAmemN, Z, C
⇔
d (3:0)
⇐
TEST (d)
reg,
mem
reg,
mem
reg,
mem
reg,
mem
reg,
mem
reg,
mem
reg,
mem
reg,
mem
-N, Z, C
-N, Z, C
-N, Z, C
-N, Z, C
-N, Z, C
-N = 0, Z, C
-N, Z
-N, Z
13/26
ST7FLITE0 QUICK REFERENCE NOTE
Table 5. Instruction Set
MnemonicDescriptionOperationDest.SourceFlags
⇐
PC + 1; PUSH PC, X, A, CC;
TRAPSoftware trap
WFIWait for interruptI ⇐ 0--I = 0
XOR d, sLogical exclusive OR (d with s)d
PC
⇐
trap vector
PC
⇐
d XOR sAmemN, Z
--I = 1
Figure 2. Block Diagram
8-BIT
CORE
ALU
POWER
SUPPLY
CONTROL
(LVD + AVD)
LITE TIMER
+
WATCHDOG
12-BIT
AUTORELOAD
TIMER
FLASH
MEMORY
(1.5K Bytes)
ST7LITE
CORE
1 MHz RC OSC
+
PLL 4x or 8x
RAM
(128 Bytes)
EXTERNAL
CLOCK
DATA
EEPROM
(128 Bytes)
SPI
8-BIT ADC
+
AMPLI x8
PORT A
PORT B
14/26
Figure 3. Me mory Map
0000h
007Fh
0080h
00FFh
0100h
0FFFh
1000h
107Fh
1080h
F97Fh
F980h
F9FFh
FA00h
FFDFh
FFE0h
FFFFh
Interrupt and Reset Vectors
HW Registers
RAM
(128 B yte s )
Reserved
Datas EEPROM
(128 B yte s )
Reserved
BootRom
(128 B yte s )
FLASH Memory
(1.5K Bytes)
0080h
00BF h
00C0h
00FFh
ST7FLITE0 QUICK REFERENCE NOTE
Short Addressing RAM
Address
Vector
FFE0h-FFE1h13-Not Used
FFE2h-FFE3h12SPISPI Peripheral Interrupts
FFE4h-FFE5h11LITE TIMER LITE TIMER RTC Interrupt
FFE6h-FFE7h10LITE TIMER LITE TIMER Input Capture Interrupt
FFE8h-FFE9h9AT TIMER AT TIMER Overflow Interrupt
FFEAh-FFEB h 8A T TIMER AT TIMER O utput Compare Interrupt
FFECh-FFEDh 7SIAVD Interrupt
FFEEh-FFEFh 6-Not Used
FFF0h-FFF1h5-Not Used
FFF 2 h-FFF3h4ei3Exter nal Interrup t 3
FFF 4 h-FFF5h3ei2Exter nal Interrup t 2
FFF 6 h-FFF7h2ei1Exter nal Interrup t 1
FFF 8 h-FFF9h1ei0Exter nal Interrup t 0
FFFAh-FFFBh 0-Not Used
FFFCh-FFFDh-TRAPSoftware Interrupt
FFFEh-FFFFh-RESETReset
(Zero Page)
Stack
(64 Bytes)
Source
N Description
Block
Register
Label
SPICSR
LTCSR
LTCSR
ATCSR
PWM0CSR
SICSR
-
N/A
N/A
N/A
N/A
N/A
Priority
Lowest
HighestN/A
Figure 4. Option Bytes
DEFAULT VALUE = FFFCh
PLL
15
x4x8
PLL
OFF
OSC
LVD1
LVD0
WDG
OPTION BYTE 1
SW
WDG
8
HALT
7
1
1
1
1
SEC1
SEC0
FMP
OPTION BYTE 0
R
FMP
0
W
0 = PLL x 4
1 = PLL x 8
0 = PLL ENABLED
1 = PLL DISABLED
RESERVED
0 = RC OSCILLATOR ON
1 = RC OSCILLATOR OFF
00 = LOWEST VOLTAGE THRESHOLD (~2.8 V)
01 = MEDIUM VOLTAGE THRESHOLD (~3.5 V)
10 = HIGHEST VOLTAGE THRESHOLD (~4.1 V)
11 = L VD OFF
0 = HARDWARE WATCHDOG
1 = SOFTWARE WATCHDOG
0 = NO RESET GENERATION IN HALT
1 = RESET GENERATION IN HALT
ADC CLOCK SPEED
(USED TOGETHER WITH THE SPEED BIT)
0 = AMPLIFIER OFF
1 = AMPLIFIER ON (f
RESERVED, FORCED BY HARDWARE TO 0
MUST BE ≤ 2 MHz)
ADC
25/26
ST7FLITE0 QUICK REFERENCE NOTE
“THE PRESENT NOTE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR
CONSEQUENT IAL DAMAGES WI TH RESPECT TO ANY CLAIMS ARIS ING FROM THE CONTENT OF
SUCH A NOTE AND/OR THE USE MADE BY CUSTOMERS OF THE INFORMATION CONTAINED
HEREIN IN CONNEXION WITH THEIR PRODUCTS.”
Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences
of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted
by implic ation or otherwise under any patent or patent ri ghts of STM i croelectr oni cs. Spec i fications mentioned i n this publication are subje ct
to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not
authorized for use as cri tical comp onents in life support dev i ces or systems wi thout the express written approv al of STMicroel ectronics.
The ST logo is a registered trademark of STMicroelectronics
2003 STMicroelectronics - All Rights Reserved.
STMicroelectronics Group of Compan i es
http://www.s t. com
Purchase of I
2
C Components by STMicroelectronics conveys a license under the Philips I2C Patent. Rights to use the se components in an
2
C system i s granted pro vi ded that the sy stem conforms to the I2C Standard Specification as defined by Philips.
I
Australi a - B razil - Canada - China - Finl and - France - Germany - Hong Kong - Ind ia - Israel - Italy - Japan
Malaysi a - M al ta - Morocco - Singapore - Spain - Sw eden - Switz erland - United Kingdom - U.S.A.
26/26
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.