Simple PWM in HALO (MAC57D5MB)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simple PWM in HALO (MAC57D5MB)

345 Views
sverdaguer
Contributor I

Hello everyone,

My team and I are working in development board MAC57D5MB(Halo) with MQX 4.2 and IAR ARM version 7.50.1.

We know that MQX non support PWM and we tried to do in bare metal but it doesn't work. We want to generate a simple PWM with pin PN8.

I attached our code:

int mask;
mask = SIUL2_CONFIG_OBE;
mask = (mask << 16) | 3;
SIUL2.MSCR[200].R = mask; /* PN8 */

FTM2_MODE = 0x0000;

FTM2_MOD = 0x0063; /* 0x0063 / 60MHz = 1.6666uS PWM period */

/* Configure timers for edge aligned PWM High True Pulses */
printf("FTM2_ Edge_Aligned Test 1\r\n");
printf("Please check the waveform, 90% High True EPWM\r\n");

FTM2_C0SC = 0x28; /* No Interrupts; High True pulses on Edge Aligned PWM */
FTM2_C1SC = 0x28;

FTM2_C0V = 0x005A; /* 90% pulse width */
FTM2_C1V = 0x005A;

FTM2_SC = 0x08; /* Edge Aligned PWM running from BUSCLK / 1 */
FTM2_MODE = 0x0009;

Thank you for advance,

Sergi.

Tags (1)
0 Replies