This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PWM for FRDM KL25Z board

Hi

I am writing bare-metal code for PWM generation for the FRDM-KL25Z board.
I followed the steps in the datasheet bit I dont seem to see anything coming from the pin. 
Would appreciate some help to see what I am missing.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "MKL25Z4.h" // Device header
/*
PTB18 -> TM2 CH0
PTB19 -> TM2 CH1
*/
#define PTB18_Pin 18
#define PTB19_Pin 19
#define PTB18_PWM_Ch 0
#define PTB19_PWM_CH 1
#define MASK(x) (1 << (x))
/* intiPWM() */
void initPWM(void)
{
//Enable Clock Gating for PORTB
SIM_SCGC5 |= SIM_SCGC5_PORTB_MASK;
// Configure Mode 3 for the PWM pin operation
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thanks!

0