element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Educational BoosterPack MKII and Hercules LaunchPad - LCD Driver part 3: PWM for the backlight
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 25 May 2018 2:41 PM Date Created
  • Views 828 views
  • Likes 4 likes
  • Comments 2 comments
  • hercules rm46
  • educational_boosterpack
  • lcd
  • boosterpack
  • launchpad
Related
Recommended

Educational BoosterPack MKII and Hercules LaunchPad - LCD Driver part 3: PWM for the backlight

Jan Cumps
Jan Cumps
25 May 2018

This blog series explains how to use the Educational BoosterPack LCD with a Hercules LaunchPad.

The Educational BoosterPak MKII is a hot item. It has many sensors on board. and a joystick, a buzzer, a 3-colored LED, buttons and a microphone.
And also a very nice color LCD screen.

The first post was an intro to my driver library for that LCD. In the previous one we set up the generic I/O.
This time it's PWM time. We'll do all the set-up to control the brightness of the LCD backlight.

image

The Schema

Before diving head-first into the configuration, let's check the BoosterPack's schematics.

You can see that the backlight of the LCD is controlled by transistor Q4. We should feed a PWM signal into that transistor's base.
The duty cycle of that signal would then regulate the backlight brightness.
But if we'd just provide that PWM signal, we'd see that we don't drive the LCD backlight. It's the RGB LED's red die that lights up in stead.

Trace back the base signal of that transistor, and you'll see what's happening: the signal going to the basis of Q4 is shared with that RGB LED.

Jumper J5 lets you choose the function. By default it is routing the signal to the driver of the LED.
If we move the jumper to the down position (bridging pin 2 and 3), the signal connects to our Q4 via R32, and we're good.image

image

The input signal (the one that goes to the middle pin of J5) is broken out to pin 39 of BoosterPack connector J4. That's the one that we'll drive with our Hercules LaunchPad.

image

The LaunchPad side

BoosterPack's J4.39 hits the J4.2 of the Hercules RM46 LaunchPad. That happens to be a dual purpose pin.
It's usable as a High End Timer (HET) or PWM signal. We'll use the HALCoGen PINMUX screen to give it PWM functionality.

image

Let's open HALCoGen and do the necessary configurations.

  • Enable the PWM driver, and enable PWM module 6 (that's the one that drives ePWM6A)

image

 

  • Set the multiplex option to PWM

image

 

  • For the time being, configure the signal to have a duty cycle of 100% (full brightness) and a frequency above the audio range.

image

Once again, there's very little coding to do in our firmware.

#include "etpwm.h"
// ...
    etpwmInit();
// ...
    etpwmStartTBCLK();

 

You can change the brightness of the backlight by calling the API function etpwmSetCmpA().

 

 

Blog Series
Educational BoosterPack MKII and Hercules LaunchPad - LCD Driver part 1
Educational BoosterPack MKII and Hercules LaunchPad - LCD Driver part 2: GIO configuration
Educational BoosterPack MKII and Hercules LaunchPad - LCD Driver part 3: PWM for the backlight
Educational BoosterPack MKII and Hercules LaunchPad - LCD Driver part 4: Draw, Write and show Bitmaps
  • Sign in to reply

Top Comments

  • DAB
    DAB over 5 years ago +1
    Very good post Jan. DAB
  • DAB
    DAB over 5 years ago

    Very good post Jan.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago

    Thanks for the clear explanation and detail.  I have not used this family of microcontrollers and the differences with others is interesting.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube