element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
  • Settings
Internet of the Backyard
  • Challenges & Projects
  • Design Challenges
  • Internet of the Backyard
  • More
  • Cancel
Internet of the Backyard
Blog [iot_umbrella] #8 lcd - description
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: .lukasz.
  • Date Created: 14 Oct 2014 12:11 PM Date Created
  • Views 505 views
  • Likes 1 like
  • Comments 2 comments
  • iot_backyard
  • iot_umbrella
Related
Recommended

[iot_umbrella] #8 lcd - description

.lukasz.
.lukasz.
14 Oct 2014

In project I used lcd from nokia 5110 (PCD8544 driver),

It is monochrome graphic lcd with resolution 84x48 pixels

 

In used ready hardware ( foto below )

image

and connected it into CC3200 LaunchPad ( schematic below )

 

image

 

Communication with lcd is done via SPI ( in one side mc->lcd )

 

I wrote software spi algorithm (code below )

void LcdSpiInit()
{
    // Configure PIN_05 for GPIOOutput (SPI_CLK)
    MAP_PinTypeGPIO(PIN_05, PIN_MODE_0, false);
    MAP_GPIODirModeSet(SPI_CLK_PORT, SPI_CLK_PIN, GPIO_DIR_MODE_OUT);

    // Configure PIN_02 for GPIOOutput (SPI_MOSI)
    MAP_PinTypeGPIO(PIN_02, PIN_MODE_0, false);
    MAP_GPIODirModeSet(SPI_MOSI_PORT, SPI_MOSI_PIN, GPIO_DIR_MODE_OUT);

    GPIOPinWrite(SPI_CLK_PORT,  SPI_CLK_PIN, SPI_CLK_PIN);
}

void SpiWriteByte(uInt8 data)
{
    uInt8 idx, l_data;

    l_data = data;

    for(idx=0; idx<8; idx ++)
    {
        GPIOPinWrite(SPI_CLK_PORT,  SPI_CLK_PIN, 0x00);

        if((l_data & 0x80) == 0x80)
           GPIOPinWrite(SPI_MOSI_PORT,  SPI_MOSI_PIN, SPI_MOSI_PIN);
        else
           GPIOPinWrite(SPI_MOSI_PORT,  SPI_MOSI_PIN, 0x00);

        MAP_UtilsDelay(DELAY_CLK_1_US);
        GPIOPinWrite(SPI_CLK_PORT,  SPI_CLK_PIN, SPI_CLK_PIN);
        MAP_UtilsDelay(DELAY_CLK_1_US);

        l_data = l_data << 1;
    }

}

 

 

In project I use lcd in text mode but mostly in graphic mode

I am printing: system init screens, weather icons, and weather forecast emoticons.

 

image

image

image

 

Bitmaps are designed in freeware software: micro LCD (in attachment)

( Firstly I wrote my own bmp converter, is somebody want I can share it )

 

image

 

Lcd usage procedures are witten in C:

 

void LcdInit()
{
    GPIOPinWrite(PWR_PORT, PWR_PIN, PWR_PIN);         // power on
    GPIOPinWrite(SCE_PORT, SCE_PIN, 0x00);            // sce
    GPIOPinWrite(RES_PORT, RES_PIN, 0x00);            // reset on


   // Delay to keep printing speed reasonable. About 100 milliseconds.
    MAP_UtilsDelay(800000);


    GPIOPinWrite(RES_PORT, RES_PIN, RES_PIN);            // reset off
    GPIOPinWrite(SCE_PORT, SCE_PIN, SCE_PIN);            // sce

    LcdWriteCommand( 0x21 );                    // LCD Extended Commands.
    LcdWriteCommand( 0xC8 );                    // Set LCD Vop (Contrast).
    LcdWriteCommand( 0x06 );                    // Set Temp coefficent.
    LcdWriteCommand( 0x13 );                    // LCD bias mode 1:48.
    LcdWriteCommand( 0x20 );                    // LCD Standard Commands, Horizontal addressing mode.
    LcdWriteCommand( 0x08 );                    // LCD blank
    LcdWriteCommand( 0x0C );                    // LCD in normal mode.
}

 

Full code is available in attachment

In one with my previous posts I share LCD usage video,

Here is a link ( soon now I have problem with add a links )

 

 

best regards

Lukasz, Poland

Attachments:
lcd.c.zip
lcd.h.zip
fonts.h.zip
bitmaps.h.zip
https://community.element14.com/cfs-file/__key/communityserver-blogs-components-weblogfiles/00-00-00-01-12/microlcd.jar
  • Sign in to reply
  • .lukasz.
    .lukasz. over 10 years ago in reply to DAB

    thanks

    my first lcd was alphanumeric 2x16 lcd with driver hd44780

     

    mostly when I am coding

    I have 100 or more files in project and what can I show for boss ?

    "blinking led"

    when device have lcd situation is better

    because I like working with LCDs,,,

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

    Nice update.

     

    I remember building bitmaps in binary in the early 1980's.

    We were using a 400x400 pixel display and I had complaints about the speed so I took them to an arcade palace and showed them that the games used 128x128 to get the speed the wanted.

    After that they agreed that given the detail of my bit maps, I was reasonably fast.

     

    DAB

    • 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 © 2025 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