The Educational BoosterPack MK II, the Texas Instruments kit with loads of goodies. Who hasn't seen it?
I have one. And I have plans with it. I want to turn it into the user interface for a safety features test bed for Hercules micro controllers.

 

logic analyzer setup

 

Today's exercise is to hook up a logic analyzer. I'm going to PWM the LCD backlight as a proof of concept of that setup.

 

 

Set Up the Logic Analyzer

 

I have matched BoosterPack singals with the LaunchPad functions in the previous post.

And I put colors next to the functions. Those are the colors of the jumper wires that go to my logic analyzer.

 

wiring the logic analyzer

 

I'm setting up my analyzer in a similar way. I've kept the order and names of the list above. I've also given the signals the same color as the wires.

I make the height of the SOMI signal bigger. When we use the analyzer's protocol decode function, we'll need the space to show the values under the signal.

 

logic analyzer primed

 

When I'm decoding SPI later on (the firmware isn't ready for that yet), I'll trigger the sample on the chip select going low.

 

Drive the LCD Background Light

 

Before starting with the real work of talking to the LCD, I want to have a quick win. Something where I can prove to myself that all is good to start.

And something that tests the logic analyzer.

The easiest thing is to drive the brightness of the backlight. The BoosterPack's pin 39 on connector J4 accepts a PWM signal.

That signal can either drive the brightness of the red led on the board, or the backlight of the LCD screen if you move jumper J5.

So I did that. I configured my LaunchPad to deliver an approx. 50 kHz PWM signal. I can alter the brightness of the backlight by changing the duty cycle of that signal.

 

Most of the work is done in HALCoGen. We configure our hardware PWM module there.

 

  • First we enable the driver

 

 

  • Then we activate the PWM function for the multiplexed pin that's going to pin 39 on connector J4

 

  • We enable the correct PWM module that drives that pin (EPWM 6A)

 

 

  • And our last activity is to set it to 50 kHz, and define the duty cycle.

 

In our firmware, the whole setup will be applied if we add three lines of code to our program.

 

#include "etpwm.h"

  etpwmInit();
  etpwmStartTBCLK();

 

When I build my project and run the code, I can check if my logic analyzer picks up the PWM signal.

 

pwm signal for the backlight

note: on the capture, the frequency is not exactly 50 kHz, and the duty cycle isn't 540%.

That's because this is a real live action photo taken when I was trying to manipulate the values from within the code.

The controller is perfectly capable to deliver the 50 kHz.

note 2: the SPI signals show that I'm actually farther in my effort than what I show here.
You can see that I've already configured the SPI module and that it initialises itself at the start of execution,

right before the activation of the PWM clock.

 

That's it for today. I can now start to flesh out the energia code examples and start the porting exercise to Hercules.

 

 

Related Blog
Educational BoosterPack and Hercules LaunchPad: LCD Driver - Part 1
Part 2: Logic Analyzer and LCD Backlight
Part 3: SPI Works
Part 4: Everything Works