This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432 LaunchPad V2 with EDUMKII running Keil uvision V5.20 and MSPWare 3.40.00.25 no LCD output

Other Parts Discussed in Thread: MSP432P401R, MSP432WARE, BOOSTXL-EDUMKII

I've tried all the examples (except for Microphone FFT who’s code size was to big for Keil) and never see any output on the LCD.

I've copied the LCD data to the Serial channel and see the applications seem to be working, just no LCD output.

QUESTON 0: Have you used my hardware/software setup and did the LCD work?

A Keil application for MSP432 LaunchPad seems to use a code skeleton of :
startup_msp432p401r_uvision.s         //initialize the interrupt vectors & stack, call SystemInit, call _main
system_msp432p401r.c                       //contains SystemInit, sets vcoreX, waits, and mclk
_main.c                                                //any additional initialization and loop on application code

Within SystemInit prior to updating the CS registers, CS->KEY is set to unlock the CS module.
The __main for these LCD example applications update the clock before the application loop.

QUESTION 1: Below in main I don’t see CS->KEY set, is this handled by the “MAP_CS_setDCOCenteredFrequency” and “MAP_CS_init_ClockSignal”?

void main(void)
{
    /* Halting WDT and disabling master interrupts */
    MAP_WDT_A_holdTimer();
    MAP_Interrupt_disableMaster();
    /* Set the core voltage level to VCORE1 */
    MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
    /* Set 2 flash wait states for Flash bank 0 and 1*/
    MAP_FlashCtl_setWaitState(FLASH_BANK0, 2);
    MAP_FlashCtl_setWaitState(FLASH_BANK1, 2);
    /* Initializes Clock System */
    MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48);
    MAP_CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
    MAP_CS_initClockSignal(CS_HSMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
    MAP_CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
    MAP_CS_initClockSignal(CS_ACLK, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_1);
    /* Initializes display */
    Crystalfontz128x128_Init();
… more of _main

Within Crystalfontz128x128_Init() the spi is configured

eUSCI_SPI_MasterConfig config =

       {
           EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
           LCD_SYSTEM_CLOCK_SPEED,
           LCD_SPI_CLOCK_SPEED,
           EUSCI_B_SPI_MSB_FIRST,
           EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT,
           EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW,
           EUSCI_B_SPI_3PIN
       };

LCD_SYSTEM_CLOCK_SPEED is defined as 48,000,000.
LCD_SPI_CLOCK_SPEED         is defined as 16,000,000   (1/3 of the system clock).

The main above sets the DCO to 48MHz and 1 divisor for MCLK, HSMCLK, and SMCLK.

QUESTION 2: Should this configuration work (with the __main clock init shown)?


Shouldn’t the MCLK be running off HFXT 48MHz crystal, with SMCLK off DCO running at 16MHz?
QUESTION 3: If this is true which of the two DCO ranges are recommended and what
should be the value of Ndcotune (Kdcoconst and FCALcsdcoxrcal values)?

Thank you for feedback,

Morris



  • Question 2: CS->KEY is init in the MAP_* functions (from driverlib\cs.c).

  • Sorry, not Question 2 but question 1 has CS->KEY initialized.
  • I've updated _main to try and configure the mclk and smclk to 48 & 16MHz respectively, adding the SysTick LED blink and updating the UART BAUD rate for the smclk freq.

    #ifdef  _ORIGINAL_     
        /* Set the core voltage level to VCORE1 */
        MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
    
        /* Set 2 flash wait states for Flash bank 0 and 1*/
        MAP_FlashCtl_setWaitState(FLASH_BANK0, 2);
        MAP_FlashCtl_setWaitState(FLASH_BANK1, 2);
      
        /* Initializes Clock System */
        MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48);
        MAP_CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
        MAP_CS_initClockSignal(CS_HSMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
        MAP_CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
        MAP_CS_initClockSignal(CS_ACLK, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_1);
    #else
        /* Enabling FPU for DCO Frequency calculation */
        MAP_FPU_enableModule();
        
        /* Setting the DCO Frequency to a non-standard 16MHz */
        MAP_CS_setDCOFrequency(16000000);
          
        /* Configuring pins for peripheral/crystal usage */
        MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_PJ,
                GPIO_PIN3 | GPIO_PIN2, GPIO_PRIMARY_MODULE_FUNCTION);
        /* Configuring pins for LED for output */
        MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
        
        /* Just in case the user wants to use the getACLK, getMCLK, etc. functions,
         * let's set the clock frequency in the code. 
         */
        CS_setExternalClockSourceFrequency(32000,48000000);
    
        /* Starting HFXT in non-bypass mode without a timeout. Before we start
         * we have to change VCORE to 1 to support the 48MHz frequency */
        MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
        MAP_FlashCtl_setWaitState(FLASH_BANK0, 2);
        MAP_FlashCtl_setWaitState(FLASH_BANK1, 2);
        CS_startHFXT(false);
    
        /* Initializing MCLK to HFXT (effectively 48MHz) */
        MAP_CS_initClockSignal(CS_MCLK, CS_HFXTCLK_SELECT, CS_CLOCK_DIVIDER_1);
        /* Initializing SMCLK to DCO (effectively 16MHz) */
        MAP_CS_initClockSignal(CS_HSMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
        MAP_CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
        MAP_CS_initClockSignal(CS_ACLK, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_1);
        
        /* Configuring SysTick to trigger at 48000000 (MCLK is 48MHz so this will 
         * make it toggle every 1.0s) */
        MAP_SysTick_enableModule();
        MAP_SysTick_setPeriod(48000000);
        MAP_Interrupt_enableSleepOnIsrExit();
        MAP_SysTick_enableInterrupt();  
    #endif    

    I used the MSP432Ware/driverlib/CS/cs_dco_frequency_tune and cs_hfxt_start examples for my changes.
    Observing the LED blink it seems to be flashing at 600 msec. interval (for 48MHz mclk).
    The UART output is still readable (for 16MHz smclk).

    BUT still no LCD output!   what else can I try???

    Thanks, Morris

  • Hi Morris,

    First, lets make sure that your HW is working correctly and the easiest way to do this is with the CCS cloud tools (dev.ti.com).

    1. Go to dev.ti.com/.../ and import "BOOSTXL-EDUMKII Accelerometer" demo into your CCS cloud workspace.
    2. Build and download.
    3. Do you see anything on your the LCD screen??

    Also, which version of the MSP432 LP are you using (RED or BLACK)??

    Thanks,

    David
  • Hello David,

    Thank you for the update.

    I see data on the LCD from the cloud Accel. example, yea!

    I'm using the red v2.0 msp432 launchpad.

    I've downloaded the cloud project and will compare with my source to try and identify why I don't see the same behavior.

    Thanks very much, morris

  • I've compared files between the ccs and keil projects:

    all grlib (17 files) identical

    all driverlib (58 files) identical

    all lcddriver (4 files) identical

    the keil project has a RTE_Components.h which defines an alias for "msp.h" - no action

    The system_msp432p401r.c was different so I copied the ccs version to my keil project - no LCD output.

    The main.c was different so I copied the ccs version to my keil project - no LCD output.

    I upgraded uvision from 5.20 to 5.21a and the ti device pack from 2.20 to 2.21 - no LCD output.

    The startup_msp432p401r... is different on both environments - no action

    Recommendations???

    Thank you, Morris

  • Hi Morris,

    I was able to reproduce this behavior and I found a problem with the HAL_LCD_writeCommand function.

    In your HAL_MSP_EXP432P401R_Crystalfontz128x128_ST7735.c, please update writeCommand and the writeData functions to:

    //*****************************************************************************
    //
    // Writes a command to the CFAF128128B-0145T.  This function implements the basic SPI
    // interface to the LCD display.
    //
    //*****************************************************************************
    void HAL_LCD_writeCommand(uint8_t command)
    {
        // USCI_B0 Busy? //
        while (UCB0STATW & UCBUSY);
    	
        // Set to command mode
        GPIO_setOutputLowOnPin(LCD_DC_PORT, LCD_DC_PIN);
    
        // Transmit data
        UCB0TXBUF = command;
    
    	    // USCI_B0 Busy? //
        while (UCB0STATW & UCBUSY);
    
        // Set back to data mode
        GPIO_setOutputHighOnPin(LCD_DC_PORT, LCD_DC_PIN);
    }
    
    
    //*****************************************************************************
    //
    // Writes a data to the CFAF128128B-0145T.  This function implements the basic SPI
    // interface to the LCD display.
    //
    //*****************************************************************************
    void HAL_LCD_writeData(uint8_t data)
    {
        // USCI_B0 Busy? //
        while (UCB0STATW & UCBUSY);
    
        // Transmit data
        UCB0TXBUF = data;
    
        // USCI_B0 Busy? //
        while (UCB0STATW & UCBUSY);	
    }

    This should do the trick.

      Regards,

        David

  • Hello David,

    Your solution resolved my blank LCD.

    Thank you very much,

    Morris

**Attention** This is a public forum