Product specifications

R01AN0168ED0101 Rev. 01.01 23
Application Note
Chapter 5 Looking into the PWM and ZPD Tables
5.2 Values for PWM Operation
5.2.1 Channels and Precision
As can be seen from the RAM layout, for each virtual channel there are two
tables: The “regular” PWM operation table and the ZPD table.
Regarding the “regular” PWM operation table, there are two formats available,
which can be selected by the
CCPn flag.
(1) High Precision Mode
In high precision mode (CCPn set), for one turn of the motor the whole table
section is used with 512 entries. Thus, the RAM is addressed in the following
way, which also defines the layout of data to be copied there by the application:
Figure 5-2 PWM Table Addressing Layout for High Precision Channels
In high precision mode, 512 angle positions can be stored, but there will be no
distinguishing of the characteristic for current speed and direction of the motor.
(2) Low Precision Mode
In low precision mode (CCPn cleared), the table section is divided into 4
equally sized parts, with 128 entries each. Thus, the RAM is addressed in the
following way, which also defines the layout of data to be copied there by the
application:
Figure 5-3 PWM Table Addressing Layout for Low Precision Channels
In low precision mode, 128 angle positions can be stored, but there are 4
tables to distinguish for speed and direction of the motor. Speed and direction
flags are corresponding to the variables
VSPn and VDRn of the Movement
Calculator
. These variables are automatically calculated, and they are
depending on some parameters (speed limits, current position, target position).
Like this, optimized table sets can be stored, which are depending on the
motor characteristics, and which are dynamically switched during operation
and motor movement.
MICROSTEP[8:0] from Movement CalculatorChannel Settings Always zero
CCTn
(000B ... 101B)
Bits 10 ... 2 A1 A0
MICROSTEP[6:0] from Movement CalculatorChannel Settings Always zero
Speed,
Direction
CCTn
(000B ... 101B)
VSPn VDRn Bits 8 ... 2 A1 A0