Jump to content

Search the Community

Showing results for tags 'lcd16x2'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Found 1 result

  1. MSP430FR2433 LCD16x2

    Hello, I am new to to MSP environment and I would like to have some help with this project. If this is on the wrong place of the forum or something like this please tell me so I can change it. I tried to make things on my own but I got stuck for 2 weeks trying to get my LCD to work properly with my first MSP. I also have acess to a friend's MSP430G2553, but the links some of the links on the forum where broken on http://43oh.com/2010/11/lcd-special-two-ways-to-interface-a-msp430-to-an-lcd/. The conections are most probably right because I can write without problems throught Arduino, so I think the problem here is the code. I am using CCS 6.2. Thanks in advance and sorry for any grammar mistakes. #include "msp430.h" #include "intrinsics.h" #include <stdio.h> #define delay3s (int)(3*750000) #define delay2ms (int)((2/1000)*750000) #define delay5ms (int)((5/1000)*750000) #define delay100us (int)((0.1/1000)*750000) #define RS BIT1 //2.1 #define EN BIT0 //2.0 // ooooooooo ooooo oooooooo8 oooooooooo ooooo o ooooo oooo // 888 88o 888 888 888 888 888 888 888 88 // 888 888 888 888oooooo 888oooo88 888 8 88 888 // 888 888 888 888 888 888 o 8oooo88 888 // o888ooo88 o888o o88oooo888 o888o o888ooooo88 o88o o888o o888o void envia(void); void send_command (unsigned char cmd); void send_data (unsigned char data); void send_string(char *s); void lcd_init (void); void dado(void); void envia(){ P2OUT = P2OUT | (EN); // define E high signal; __delay_cycles( delay100us); P2OUT = P2OUT & ~(EN); // define E low signal __delay_cycles( delay100us); } void send_command(unsigned char cmd){ P2OUT = P2OUT &~(EN+RS); // define E low e define RS low - para mandar comandos P1OUT &= 0xF0; // send higher nibble P1OUT |= ((cmd>>4) & 0x0F); envia(); // give enable trigger P1OUT &= 0xF0; // send lower nibble P1OUT |= ((cmd) & 0x0F); envia(); // give enable trigger } void send_data(unsigned char data){ P2OUT |= (RS); // define RS high - para mandar dados P2OUT &= ~(EN); P1OUT &= 0xF0; P1OUT |= ((data>>4) & 0x0F); // send higher nibble envia(); // give enable trigger P1OUT &= 0xF0; P1OUT |= (data & 0x0F); // send lower nibble envia(); // give enable trigger } void send_string(char *s){ while(*s) { send_data(*s); s++; } } void lcd_init(void){ P2DIR |= (EN+RS); P2OUT &= ~(EN+RS); P1DIR |= (BIT4+BIT5+BIT6+BIT7); //Dados P1OUT &= ~(BIT4+BIT5+BIT6+BIT7); //Bits P1.4 a P1.7 send_command(0x33); __delay_cycles( delay2ms ); send_command(0x32); __delay_cycles( delay2ms ); send_command(0x28); // 4bit mode __delay_cycles( delay2ms ); send_command(0x0E); //send_command(0x0E)= display on / cursor on send_command(0x0C) = display on / cursor off __delay_cycles( delay2ms ); send_command(0x01); // Clear LCD __delay_cycles( delay2ms ); send_command(0x06); // Incrementa o cursor automaticamente __delay_cycles( delay2ms ); send_command(0x80); // Cursor na casa inicial __delay_cycles( delay2ms ); } void main( void ){ WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer to prevent time out reset lcd_init(); send_command(0x01); // Clear LCD __delay_cycles( delay5ms ); send_string(" MSPLAY "); send_command(0xC0); // Linha 2 __delay_cycles( delay2ms ); send_string("By: Ivan Moraes "); __delay_cycles( delay3s ); //COLOCAR MÚSICA NO LUGAR DESSE DELAY }
×