AN1356 STMicroelectronics, AN1356 Datasheet - Page 36

no-image

AN1356

Manufacturer Part Number
AN1356
Description
PSDSOFT EXPRESS AND PSD4235G2 DESIGN GUIDE
Manufacturer
STMicroelectronics
Datasheet
AN1356 - APPLICATION NOTE
To do this, make these logic assignments for the registered node, “half_clkin”:
Moving to the down-counter, let’s implement this simple 4-bit auto-reload down-counter, shown in Figure
43. It will be clocked by “half_clkin” and its output “zero” will indicate when the count has reached zero, at
which time the counter will automatically reload the initial value and count down again. The MCU will load
an initial 4-bit value just once (during a startup initialization routine) and the counter will automatically
reload this value as needed. The MCU loads the count by writing to four OMCs that we have labeled
“init_count0” through “init_count3”. The MCU just has to write to the appropriate address offset inside PSD
control register space, “csiop” to load the OMCs. See the data sheet for details on control register offsets
and functions.
Figure 43. 4-bit auto-reloading down-counter
Let’s make assignments for the clock, reset, and preset using the Design Assistant GUI, but leave each
node input equation blank (assignment will be made later when editing ABEL file). The down-counter will
be clocked with the divided clock of Figure 42. So make these assignments for the register nodes:
down_count0, down_count1, down_count2, and down_count3.
Next, make assignments for the four register nodes which hold the initial count of the down-counter. Again,
no equation will be assigned to the node inputs (this happens when editing ABEL file). Make the following
assignments for the register nodes init_count0, init_count1, init_count2, and init_count3.
36/49
half_clkin!half_clkin
half_clkin Clockclkin
half_clkin ResetGnd
half_clkin SetGnd
down_countx<blank>
down_countx Clockhalf_clkin
down_countx Reset !_reset
down_countx Set Gnd
init_countx <blank>
init_countx ClockGnd
init_countx Reset !_reset
control register space (csiop)
MCU writes to OMCs in PSD
to load initial count
half_clkin
LOAD
Q D
4-bit auto-reloading
D
MCU data bus
down-counter
(initial count)
Q C
C
Q B
B
Q A
A
term_count
ZERO
AI04084

Related parts for AN1356