element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • 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 Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
  • Settings
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum IL9163 128x128 lcd yet again (with efm32)
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 313 subscribers
  • Views 257 views
  • Users 0 members are here
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

IL9163 128x128 lcd yet again (with efm32)

msalko
msalko over 10 years ago

Hi. I'm trying to work with il9163 128x128 lcd, but i can't seem to get it to work.

all i can see is a white screen even when i try to put something on screen or something.

 

here is my code:

/*
 * LCD.c
 *
 *  Created on: 3.8.2015
 *      Author: Martin Salko
 */

#include "LCD.h"
#include "LCD_cfg.h"
#include "LCD_font.h"
#include "stdint.h"
#include <em_cmu.h>
#include <em_usart.h>
#include <em_gpio.h>
#include "delay.h"


void LCD_init(void)
{
    // enable peripheral and spi clock
    CMU_ClockEnable(cmuClock_GPIO,1);
    CMU_ClockEnable(cmuClock_USART1,1);

    // set maximal speed
    CMU_ClockDivSet(cmuClock_HFPER,1);


    GPIO_PinModeSet(LCD_CS_PORT, LCD_CS_PIN, gpioModePushPull, 1);
    GPIO_PinModeSet(LCD_CLK_PORT, LCD_CLK_PIN, gpioModePushPull, 0);
    GPIO_PinModeSet(LCD_A0_PORT, LCD_A0_PIN, gpioModePushPull, 0);
    GPIO_PinModeSet(LCD_TX_PORT, LCD_TX_PIN, gpioModePushPull, 0);
    GPIO_PinModeSet(LCD_RST_PORT, LCD_RST_PIN, gpioModePushPull, 0);
    GPIO_PinModeSet(LCD_LED_PORT, LCD_LED_PIN, gpioModePushPull, 0);

    LCD_USART->CTRL |= USART_CTRL_SYNC; //set sinchronous mode
    LCD_USART->FRAME |= USART_FRAME_DATABITS_EIGHT; // set nine databits

    LCD_USART->CMD |= USART_CMD_TXEN; // enable transmit
    LCD_USART->CMD |= USART_CMD_RXEN; // enable recieve
    LCD_USART->CMD |= USART_CMD_MASTEREN; // enable master mode

    LCD_USART->ROUTE |= LCD_USART_LOC; // set desired location
    LCD_USART->ROUTE |= USART_ROUTE_CLKPEN; //enable clock
    LCD_USART->ROUTE |= USART_ROUTE_CSPEN; //enable clock
    LCD_USART->ROUTE |= USART_ROUTE_TXPEN; //enable clock

    LCD_USART->CTRL |= USART_CTRL_CLKPHA_SAMPLELEADING; // set sample leading
    LCD_USART->CTRL |= USART_CTRL_AUTOCS; //set auotomatic cs
    LCD_USART->CTRL |= USART_CTRL_MSBF; //set most significant bit first

    LCD_USART->CLKDIV = 0xffff; // set some delay

}

void LCD_ON(void)
{
    GPIO_PinOutSet(LCD_LED_PORT, LCD_LED_PIN);
    GPIO_PinOutSet(LCD_RST_PORT, LCD_RST_PIN);

    LCD_Push(0,0x01);
    LCD_Push(0,0x00);
    LCD_Push(0,0x00);
    LCD_Push(0,0x00);
    LCD_Push(0,0x00);
    LCD_Push(0,0x11);
    LCD_Push(0,0x00);
    LCD_Push(0,0x00);
    LCD_Push(0,0x00);
    LCD_Push(0,0x00);
    LCD_Push(0,0x21);
}

void LCD_Push(uint8_t DC,uint8_t data)
{

    //wait for it
    while( !(USART1->STATUS & USART_STATUS_TXBL));

    GPIO->P[3].DOUT = (GPIO->P[3].DOUT & ~(1<<LCD_A0_PIN)) | ((DC & 1)<<LCD_A0_PIN);

    //send data
    LCD_USART->TXDATA= (data) & 0xff;

}

void LCD_pushPixel(void)
{

}

void LCD_OFF(void)
{
    LCD_Push(1,0x28);
    GPIO_PinOutClear(LCD_LED_PORT, LCD_LED_PIN);
}

void LCD_pushArea(void)
{

}

void LCD_update(void)
{

}

 

what am i doing wrong.

  • Sign in to reply
  • Cancel
Parents
  • msalko
    0 msalko over 10 years ago

    oh. thanks a lot!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • msalko
    0 msalko over 10 years ago

    oh. thanks a lot!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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 © 2026 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