Skip to main content

Posts

Showing posts from February, 2018

Project 5 - LED Brightness using PWM (using libraries)

So far we have used and experimented on GPIO modules (in peripherals). Now in this tutorial/project we shall look into PWM module. From the datasheet of this micro-controller, this MCU has two PWM modules, namely PWM0 & PWM1. The on-board LED (R+B+G) is connected to PF1, PF2 and PF3 respectively. PF2 and PF3 module is connected to PWM1 module generator 3 and PF1 is connected to PWM1 module generator 2. This project will demonstrate the implementation of PWM1 gen3 to control the brightness of (G+B) LED. From this project onwards we will be using tivaware. Now lets see how to configure PWM module.  Steps to configure PWM module: Set PWM clock Enable PWM module Enable GPIO module (so that GPIO can be configured to PWM out) Set GPIO pins to PWM out Configure PWM pin modules Configure PWM generator (count up/count down/ count up-down) Set the PWM base frequency Set the PWM pulsewidth Enable output on PWM pins Enable PWM generator and set to run mode Progr...