ST7MDT20-EVC/US STMicroelectronics, ST7MDT20-EVC/US Datasheet - Page 21

no-image

ST7MDT20-EVC/US

Manufacturer Part Number
ST7MDT20-EVC/US
Description
BOARD EVALUATION/TRAINING/PROGRM
Manufacturer
STMicroelectronics
Datasheet

Specifications of ST7MDT20-EVC/US

Module/board Type
Evaluation Board
For Use With/related Products
ST72124,7231x,72321,72334,72511,72512,72521
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
Other names
497-2897
3.2 EXERCISE 2: USE OF THE 16-BIT TIMER IN ASSEMBLY LANGUAGE
Starting with a similar program frame (New Project: File, New Workspace), design a software
program for the ST72334N4 that:
1. Generates a PWM signal on pin PF4 (40-kHz frequency, 20% duty cycle).
2. Generates an interrupt every period and toggles pin PB0 defined as a push-pull output
(square wave at 20 kHz).
Refer to the ST72334 datasheet for the correct use of the timer in PWM mode.
Since the MCU uses a 16-MHz crystal, it must be configured in Normal mode and the “Divider
by 2” function must be selected for the timer clock in order to have the best accuracy.
I
I
In this exercise, the entire structure is given, but only the comment lines have been kept. The
correct ST7 code must be written by using only the comments.
3. Check the validity of your software program by displaying the signal on pins PF0 and PF4
with an oscilloscope or by using the ST7 Waveform Editor after an STVD7 simulation.
When an application is run on the simulator, a port.out file that contains all the pin changes is
automatically generated. It is used to check the operation of the application without using any
hardware.
– Configures pin PF0 as a push-pull output.
– Enters the calculated value for the pulse length and the period length in TAOC1R and
– Configures the 16-bit timer in PWM mode.
– Enables the interrupt process and waits for interrupts.
Write a main program that:
Write an interrupt routine that toggles pin PFO and clears interrupt flags ICF1and ICF2.
TAOC2R registers using the datasheet formula.
TRAINING EXERCISES
21/33

Related parts for ST7MDT20-EVC/US