Problem with LCD driver on S12HY

Showing results for 
Search instead for 
Did you mean: 

Problem with LCD driver on S12HY

Contributor II

  Hello ALL!

I have a problem with an LCD controller on MCU 9S12HY64. LCD has 5V, 1/4 Duty, 1/3 Bias parameters. VLCD is connected to + 5V. The LCDCR0 control register is set to 0x90, and I also went through all the other possible values. The BP0..3 waveform is invalid, see the figure in the appendix. They don't have four voltage levels, only two levels. I change chip on PCB to another, but it's no results. May both chips have damaged LCD controller hardware? I try both IDEs - IAR and CW, there are no differences.

4 Replies

Contributor II

Ticket is closed, defect is localised in PCB on inductance L1, so the problem with LCD was succesfully resolved.

Thank you!

0 Kudos

NXP Employee
NXP Employee

Hello Val PVG,

hard to say what is the main reason for that behavior.

Could you please closer specify the used hardware? Do you use S12HY demo board or your own PCB?

In the case of your own PCB, please specify MCU package, LCD type, and share schematic if possible.

Do you use demo software as a template or you have your own code?

I would like to recommend configure the clock, bias, and duty as first prior you enable the LCD. The front planes enable bits should be configured also prior you set the LCDEN bit. 


The frame frequency seems to be higher than recommended (200Hz, if I see correctly from picture). Could you please try to increase the divider?

Best regards


Contributor II

  Hello Radek Sestak!

I use own PCB, not a Demo Board. MCU is MC9S12HY64J0CLLR, package TQFP100, quartz resonator is 4MHz.

Custom segment LCD: TN, 5V, 1/4 Duty, 1/3 Bias. Schematic:

a) MCU part


b) LCD part


Yes, I se demo software of the Demo Board. My code is here -

void Init_LCD () {      
    LCDCR0_bit.DUTY0 = 0;    /* LCD Duty - 1/4 */
    LCDCR0_bit.DUTY1 = 0;
    LCDCR0_bit.BIAS = 0;    /* LCD Bias - 1/3 */
    LCDCR0_bit.LCLK0 = 0;    /* Frame Frequency - 144 Hz */
    LCDCR0_bit.LCLK1 = 1;
    LCDCR0_bit.LCLK2 = 0;

    LCDCR1_bit.LCDSWAI = 0;    /* LCD operates normally in wait mode */


    FPENR0 = 0xF8;            /* LCD Frontplane FP0, FP1 , FP2 disabled, FP3 - FP7 enabled */
    FPENR1 = 0xFF;            /* LCD Frontplane FP8 - FP15 enabled */
    FPENR2 = 0xFF;            /* LCD Frontplane FP16 - FP23 enabled */
    FPENR3 = 0x7F;            /* LCD Frontplane FP24 - FP30 enabled, FP31 disabled */
    FPENR4 = 0x00;            /* LCD Frontplane FP32 - FP39 disabled */

    LCDCR0_bit.LCDEN = 1;    /* LCD driver system is enabled *


About frame clock,

IRCCLK by def is 1MHz, as the datasheet formula we have LCD Frame Frequency (Hz) = 1000 000/ 4096 * 1/4 = 61 Hz

0 Kudos

Contributor II

You are right, in the picture frame clock was 244Hz, then I decrease it, but waveform is not changed.

0 Kudos