Product specifications

R01AN0168ED0101 Rev. 01.01 25
Application Note
Chapter 5 Looking into the PWM and ZPD Tables
(1) Example of a Sine - Cosine Sequence PWM Table
When writing PWM tables into the PWM Value RAM, a standard table for a
quick start could look like the following table. For different speed levels and
directions, the same table can be used.
This table is “right turning”, because the sequence of quadrants is 4, 3, 2, 1.
The used access type is shown in advance of the table.
/*............... ISM PWM RAM access structures ..................*/
#define EE_ISM_SPEEDS ( 2 )
#define EE_ISM_DIRECTIONS ( 2 )
#define EE_ISM_TABLESIZE_STD ( 128 )
typedef struct eeism_pwmcell_t {
volatile u32_t cvp : 10;
volatile u32_t chp : 10;
volatile u32_t cqi : 2;
volatile u32_t ivr : 1;
volatile u32_t ihr : 1;
volatile u32_t UNUSED : 8;
} eeism_pwmcell_t;
typedef struct eeism_pwmstd_t {
struct eeism_pwmcell_t std[ EE_ISM_SPEEDS ]
[ EE_ISM_DIRECTIONS ]
[ EE_ISM_TABLESIZE_STD ];
} eeism_pwmstd_t;
/* Default PWM Table: SINE on CVP, COSINE on CHP */
const struct eeism_pwmstd_t EE_ISM_A_STDPWMTABLE1 = {
/* CVP CHP CQI IVR IHR */
{
{{{ 0x000L, 0x3FFL, 0x3L, 1L, 1L, 0L }, /* 4th quadrant */
{ 0x032L, 0x3FDL, 0x3L, 1L, 1L, 0L },
{ 0x064L, 0x3FAL, 0x3L, 1L, 1L, 0L },
{ 0x096L, 0x3F3L, 0x3L, 1L, 1L, 0L },
{ 0x0C7L, 0x3EBL, 0x3L, 1L, 1L, 0L },
{ 0x0F8L, 0x3E0L, 0x3L, 1L, 1L, 0L },
{ 0x128L, 0x3D2L, 0x3L, 1L, 1L, 0L },
{ 0x158L, 0x3C3L, 0x3L, 1L, 1L, 0L },
{ 0x187L, 0x3B1L, 0x3L, 1L, 1L, 0L },
{ 0x1B5L, 0x39CL, 0x3L, 1L, 1L, 0L },
{ 0x1E2L, 0x386L, 0x3L, 1L, 1L, 0L },
{ 0x20DL, 0x36DL, 0x3L, 1L, 1L, 0L },
{ 0x238L, 0x352L, 0x3L, 1L, 1L, 0L },
{ 0x261L, 0x335L, 0x3L, 1L, 1L, 0L },
{ 0x288L, 0x316L, 0x3L, 1L, 1L, 0L },
{ 0x2AFL, 0x2F5L, 0x3L, 1L, 1L, 0L },
{ 0x2D3L, 0x2D3L, 0x3L, 1L, 1L, 0L },
{ 0x2F5L, 0x2AFL, 0x3L, 1L, 1L, 0L },
{ 0x316L, 0x288L, 0x3L, 1L, 1L, 0L },
{ 0x335L, 0x261L, 0x3L, 1L, 1L, 0L },
{ 0x352L, 0x238L, 0x3L, 1L, 1L, 0L },
{ 0x36DL, 0x20DL, 0x3L, 1L, 1L, 0L },
{ 0x386L, 0x1E2L, 0x3L, 1L, 1L, 0L },
{ 0x39CL, 0x1B5L, 0x3L, 1L, 1L, 0L },
{ 0x3B1L, 0x187L, 0x3L, 1L, 1L, 0L },
{ 0x3C3L, 0x158L, 0x3L, 1L, 1L, 0L },
{ 0x3D2L, 0x128L, 0x3L, 1L, 1L, 0L },