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
    • Experts & Guidance
    • 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 and Hercules LaunchPad: LCD Driver - Part 2: Logic Analyzer and LCD 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: 11 Apr 2016 7:21 PM Date Created
  • Views 354 views
  • Likes 2 likes
  • Comments 3 comments
  • logic analyzer
  • lcd
  • boosterpack
  • pwm
  • papilio
  • spi
  • boostxl-edumkii
  • logic_sniffer
  • hercules
  • launchpad
Related
Recommended

Educational BoosterPack and Hercules LaunchPad: LCD Driver - Part 2: Logic Analyzer and LCD Backlight

Jan Cumps
Jan Cumps
11 Apr 2016
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.

 

image

 

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.

image

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

 

image

 

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.

 

image

 

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

 

image

 

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

image

 

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

 

image

 

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

 

image

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.

 

image

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
  • Sign in to reply

Top Comments

  • DAB
    DAB over 7 years ago +1
    Nice update Jan. I can see how you could expand your idea to cover more channels. Good job. DAB
  • clem57
    clem57 over 7 years ago in reply to Jan Cumps

    Text book perfect Jan Cumps. Nice style of writing, thanks.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 7 years ago

    A screenshot of the PWM signal without me messing with it in the firmware. A nice stable 50 kHz.

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 7 years ago

    Nice update Jan.

     

    I can see how you could expand your idea to cover more channels.

     

    Good job.

    DAB

    • Cancel
    • Vote Up +1 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

  • X
  • Facebook
  • linkedin
  • YouTube