NPEDUCATIONS, Electronic circuits development, electronics tutorials, microcontroller tutorials and projects, advanced microcontroller (ARM) based tutorials and projects, Embedded c development, Embedded c for ARM cortex M, Intel IoT based projects, IoT projects, CC3200 launch pad projects, MSP430 Launchpad tutorials and projects, Tiva C launch pad tutorials and projects, 8051 tutorials and projects, sensor interfacing with microcontroller tutorials, data communications and networking tutorials, peripheral interfacing with microcontroller, led message scrolling display, arduino based tutorials and projects, intel galileo based tutorials and project, ADC interfacing tutorials, LED Blinking, LCD interfacing, Embedded System tutorials and projects, B.tech projects, M.tech projects, online Embedded C training

Interfacing 16x2 character LCD display with MSP430 Launch pad


Interfacing 16x2 character LCD display with MSP430 Launch pad is quite simple. You just need a separate 5V power supply to drive the LCD. One of the main advantages of MSP430 Launch pad is its in-built debugging feature and its pin configuration. In this tutorial, I am not going to start from the scrap of LCD. But I encourage you to read my previous tutorials about introduction to LCD and its interfacing to microcontroller, where you can find the LCD commands, LCD functions, LCD interface mechanism etc.  In this post, I just show the connections between the LCD and MSP430 Launch pad, A test program to  display a string of characters on it, and finally a small video is presented in which output of the program is shown.

1. Construction:
Generally 16x2 character LCD displays requires eight data lines, three control lines (RS, EN, R/W) and 5v power supply and common ground. Here the microcontroller belongs to MSP430 family which runs worth 3.3v USB power supply. But the 16x2 LCD requires 5v power supply which should be provided separately. Generally, when we interface the same LCD with 8051 microcontroller there is no need of separate power supply. Why because both LCD and 8051 microcontroller works with the same 5v supply.

A small important note for you “don’t use USB power supply taken from MSP430 launch pad for LCD display” which may damage your pc USB port, so be careful about that.

All the data lines of the LCD are connected to Port 2 pins of the MSP430G2553 microcontroller and the control lines connected to Port1 pins (RS - P1.6 and EN - P1.7). Another more import thing is that connect the ground pin MSP430 Launch Pad with LCD ground pin in order form the closed loop circuit. If you won’t connect the two grounds, then you notice some garbage characters appear on the LCD display while executing the program. One more important point in this tutorial that I connected the R/W pin of the LCD to ground, because I am not performing read operation on LCD, just write operation only. For write operation the LCD R/W pin should be connected to the ground.

2. Circuit Diagram to interface 16x2 LCD with MSP430 microcontroller:

Circuit Diagram to interface 16x2 LCD with MSP430 microcontroller

Note:
      1.   Don’t use USB power supply for LCD display which is taken from the MSP430 launch pad board.      Otherwise your pc USB port may damage by drawing more current from it. 
        2.   Join MSP430 launch pad ground point with LCD ground pin in order to form a closed circuit. Otherwise garbage characters will display.



/******************************************************************************************************************************/ // http://www.npeducations.com // MSP430_LCD.c // Author - lovakiranvarma, M.tech /******************************************************************************************************************************/ #include "msp430g2553.h" #include "stdio.h" #include "string.h" #include "stdlib.h" #define delay_value 500 void LCD_Init(void) { send_cmd(0x38); // configure LCD as 2 lined 5x7 matrix delayms(delay_value); send_cmd(0x0E); //display on, cursor blink delayms(delay_value); send_cmd(0x06); // auto increment of cursor delayms(delay_value); send_cmd(0x01); // clear display delayms(delay_value); } void send_cmd(unsigned char command) { P1OUT &= 0X00; P2OUT &= 0X00; P2OUT = command; P1OUT &= 0X00; P1OUT &= ~0x40; // RS = 0 for command, P1.6 0x40 //RW is grounded P1OUT &= ~0x80; //EN = 0, P1.7, 0x80 delayms(delay_value); P1OUT |= 0x80; // EN = 1, P1.7, 0x80 delayms(delay_value); P1OUT &= ~0x80; //EN = 0, P1.7, 0x80 delayms(delay_value); } void send_char(unsigned char character) { P1OUT &= 0X00; P2OUT &= 0X00; P2OUT = character; // P1OUT &= 0x00; P1OUT |= 0x40; // RS = 0 for command, P1.6 // RW is grounded P1OUT &= ~0x80; //EN = 0, P1.7 delayms(delay_value); P1OUT |= 0x80; // EN = 1, P1.7 delayms(delay_value); P1OUT &= ~0x80; //EN = 0, P1.7 delayms(delay_value); } void send_string(char *String) { unsigned char i=0; while(String[i]!='\0') { P1OUT &= 0X00; P2OUT &= 0X00; P2OUT = String[i]; P1OUT |= 0x40; // RS = 0 for command, P1.6 // RW is grounded P1OUT &= ~0x80; //EN = 0, P1.7 delayms(delay_value); P1OUT |= 0x80; // EN = 1, P1.7 delayms(delay_value); P1OUT &= ~0x80; //EN = 0, P1.7 delayms(delay_value); if(i>=16) // If the number of characters in the string > 16, then the below command automatically send_cmd(0x18); // Shift the display right side delayms(40000); // 100 millisec delay i++; } } void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT BCSCTL1 = CALBC1_1MHZ; // Set DCO DCOCTL = CALDCO_1MHZ; BCSCTL2 &= ~(DIVS_3); //This line of code ensures that the SMCLK divider is 0, // so we have SMCLK=DCO=1MHz (in fact if we are to have a /8 divider, it should be BCSCTL2 |= DIVS_3;). P1DIR = 0xFF; // make P1 as output P2DIR = 0xFF; // make P2 as output P2SEL = 0; // These two are "Function Select Registers PxSEL and PxSEL2", P2SEL2 = 0; // If both are zero's means simple I/O function is selected. P1DIR |= 0x01; // Set P1.0 to output direction P1REN |= 0x01; delayms(1500); // wait for more than 15ms after supply rises to 4.5V send_cmd(0x30); delayms(400); // wait more than 4.1ms send_cmd(0x30); delayms(100); // wait more than 100us, but delayms(1) will provide 1ms send_cmd(0x30); delayms(100); send_cmd(0x02); // return to home delayms(100); LCD_Init(); // LCD initialization while(1) { send_cmd(0x01); // clear display delayms(delay_value); send_cmd(0x81); // clear display delayms(delay_value); send_string("NPEDUCATIONS"); delayms(delay_value); send_cmd(0xC0); // clear display delayms(delay_value); send_string("http://www.npeducations.com"); delayms(delay_value); } }
You tube video:

15 comments :

  1. Thanks for stressing on notes :

    "Join MSP430 launch pad ground point with LCD ground pin in order to form a closed circuit. Otherwise garbage characters will display."

    This saved me!

    ReplyDelete
  2. Is this code perfectly working on MSP430?

    ReplyDelete
  3. The article you have shared here very good. This is really interesting information for me. Thanks for sharing!

    ReplyDelete
  4. I think it is a mountain climbing film. It is a mind blowing film including many exclusive and adventurous scenes. That is why it i included in this years film fest

    ReplyDelete
  5. yes...Hello!
    I want you to thank for your time of this wonderful read!!! I definately enjoy every new home construction mortgage
    little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog!

    ReplyDelete
  6. how,Use other parts of the body - If your leg is injured, try working out in a second mortgage canadalifting down payment on new Key safes arms to help you still move and increase your heart rate.

    ReplyDelete
  7. I have read you post, Great work you really did it very well. Keep working like this and sharing informative posts like
    this one. keep it up. I'm waiting for your next post...
    real estate for sale

    ReplyDelete
  8. Great tips I have noted all in my diary I'll use your all tips as you mentioned I really like your article I was searching on this topic as I'm working on this topics too.you can see my work but yours is too good I personally appreciate you for this. Keep working like this.Mavic Air Singapore

    ReplyDelete
  9. I took an online photography class and it was awesome. I learned so much and had a blast doing it. Have so much fun with this class, it sounds wonderful! net worth

    ReplyDelete
  10. I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks net worth

    ReplyDelete
  11. We are the independent publication delivering news around cryptocurrency news, ICO news & Latest Blockchain news. Our platform focuses on providing news around blockchain, cryptocurrencies, distributed systems and decentralized global economy. We regularly keeps its readers updated on Bitcoin news, Ethereum news & Altcoin news. For all crypto enthusiasts, Coinpublish is the place to be.

    We make great efforts in contributing to gather unbiased and reliable information for our dedicated and influential readers across the globe. All updated information regarding price change, developments and technological advancements in cryptoverse are available on Coinpublish. Our platform allows marketers to promote latest news in the form of Press releases & Advertisements.

    Our mission is to enlighten the world about the pros and cons of cryptocurrency and blockchain. When we decided to start Coinpublish, we were in a race with strong competitors. We had to be better and different. For this, we chose to roll the dice to come up with unique ideas in order to make the platform user-friendly and informative.

    To know more about coinpublish visit the given link - www.coinpublish.com/

    Connect to Coinpublish through given links:
    Facebook - https://www.facebook.com/coinpublishdaily/
    Twitter -twitter.com/Coin_Publish
    Linkedin - in.linkedin.com/company/coinpublish





    ReplyDelete
  12. Dentist in Hamilton

    Dentists in Hamilton are really helpful and when you search for dentists Hamilton nj, you will find that you are being displayed a number of dentist in Hamilton nj and dentist in Trenton nj. But when you have to pick one, Hamilton Dental Care is the best option for you to choose.

    It is not just the regular dentistry procedures that make the Hamilton Dental Care stand out but also the cosmetic dentistry in Hamilton. When you will search for Cosmetic Dentistry in Hamilton, you are looking for the best dental health services in Hamilton.

    So next time when you are looking for a dentist in Hamilton nj, you must go to Hamilton Dental Care.

    ReplyDelete
  13. The affordable online boutique is a leading store for the fashion loving women, and it offers classy, designer and trendy outfits at economical prices. Boutique in Atlanta offers a wide range of shopping options for women of all age groups. If you are looking for women's trendy tops or boutique dresses then affordable online boutique is the destination for you. The highlighting aspect of the southern boutique is the seasonal dressing offers. It offers a wide variety from boutique summer dresses to trendy sweaters that keeps you warm. The online boutique also specializes in rompers, jumpsuits, two-piece sets, coats, vests, cardigans, boutique tops, and women's accessories. Yes! Along with the trendy tops for women, you can also get the matching accessories like hair accessories to stand out of the crowd.

    Online Boutique Store:https://www.bermere.com
    Instagram Profile: https://instagram.com/shopbermere
    Facebook Profile: https://www.facebook.com/shopbermere

    ReplyDelete

Thanks for visiting NPEDUCATIONS. We will contact you soon

15 comments :

Sandeep Tayal said...

Thanks for stressing on notes :

"Join MSP430 launch pad ground point with LCD ground pin in order to form a closed circuit. Otherwise garbage characters will display."

This saved me!

Dipankar Panda said...

Is this code perfectly working on MSP430?

Form D Offerings said...

The article you have shared here very good. This is really interesting information for me. Thanks for sharing!

Penguin statues said...

I think it is a mountain climbing film. It is a mind blowing film including many exclusive and adventurous scenes. That is why it i included in this years film fest

construction loan draw process said...

yes...Hello!
I want you to thank for your time of this wonderful read!!! I definately enjoy every new home construction mortgage
little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog!

Julia Jhonson said...

how,Use other parts of the body - If your leg is injured, try working out in a second mortgage canadalifting down payment on new Key safes arms to help you still move and increase your heart rate.

Julia Jhonson said...

I have read you post, Great work you really did it very well. Keep working like this and sharing informative posts like
this one. keep it up. I'm waiting for your next post...
real estate for sale

Julia Jhonson said...

Great tips I have noted all in my diary I'll use your all tips as you mentioned I really like your article I was searching on this topic as I'm working on this topics too.you can see my work but yours is too good I personally appreciate you for this. Keep working like this.Mavic Air Singapore

Sophie Grace said...

I took an online photography class and it was awesome. I learned so much and had a blast doing it. Have so much fun with this class, it sounds wonderful! net worth

AngelaHolt said...

Our website

Sophie Grace said...

I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks net worth

duoforpc said...

great post. Thanks for sharing this information.
click to know about tutuapp
click here

Coinpublish said...

We are the independent publication delivering news around cryptocurrency news, ICO news & Latest Blockchain news. Our platform focuses on providing news around blockchain, cryptocurrencies, distributed systems and decentralized global economy. We regularly keeps its readers updated on Bitcoin news, Ethereum news & Altcoin news. For all crypto enthusiasts, Coinpublish is the place to be.

We make great efforts in contributing to gather unbiased and reliable information for our dedicated and influential readers across the globe. All updated information regarding price change, developments and technological advancements in cryptoverse are available on Coinpublish. Our platform allows marketers to promote latest news in the form of Press releases & Advertisements.

Our mission is to enlighten the world about the pros and cons of cryptocurrency and blockchain. When we decided to start Coinpublish, we were in a race with strong competitors. We had to be better and different. For this, we chose to roll the dice to come up with unique ideas in order to make the platform user-friendly and informative.

To know more about coinpublish visit the given link - www.coinpublish.com/

Connect to Coinpublish through given links:
Facebook - https://www.facebook.com/coinpublishdaily/
Twitter -twitter.com/Coin_Publish
Linkedin - in.linkedin.com/company/coinpublish





Dentist in Hamilton said...

Dentist in Hamilton

Dentists in Hamilton are really helpful and when you search for dentists Hamilton nj, you will find that you are being displayed a number of dentist in Hamilton nj and dentist in Trenton nj. But when you have to pick one, Hamilton Dental Care is the best option for you to choose.

It is not just the regular dentistry procedures that make the Hamilton Dental Care stand out but also the cosmetic dentistry in Hamilton. When you will search for Cosmetic Dentistry in Hamilton, you are looking for the best dental health services in Hamilton.

So next time when you are looking for a dentist in Hamilton nj, you must go to Hamilton Dental Care.

Affordable Online Boutique said...

The affordable online boutique is a leading store for the fashion loving women, and it offers classy, designer and trendy outfits at economical prices. Boutique in Atlanta offers a wide range of shopping options for women of all age groups. If you are looking for women's trendy tops or boutique dresses then affordable online boutique is the destination for you. The highlighting aspect of the southern boutique is the seasonal dressing offers. It offers a wide variety from boutique summer dresses to trendy sweaters that keeps you warm. The online boutique also specializes in rompers, jumpsuits, two-piece sets, coats, vests, cardigans, boutique tops, and women's accessories. Yes! Along with the trendy tops for women, you can also get the matching accessories like hair accessories to stand out of the crowd.

Online Boutique Store:https://www.bermere.com
Instagram Profile: https://instagram.com/shopbermere
Facebook Profile: https://www.facebook.com/shopbermere

Post a Comment

Thanks for visiting NPEDUCATIONS. We will contact you soon

If you really like this tutorial, Don't forget to give the comment or please subscribe to the RSS feed by submitting your E-mail or like our Facebook page.

 
Powered by Blogger