adjunto el codigo para que lo revisen, es un codigo que encontre en la web pero lo adapte al micro que yo ocupo...
espero de esta manera me puedan ayudar..
#include <msp430x14x.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
//
// MSP430 LCD Codigo
//
#define LCM_DIR P2DIR
#define LCM_OUT P2OUT
//
// definicion de puertos de acuerdo al easyweb2
// asignamos pines para datos a 4,5,6,7 y config
//
#define LCM_PIN_RS BIT2 // P2.2
#define LCM_PIN_EN BIT3 // P2.3
#define LCM_PIN_D7 BIT7 // P2.7
#define LCM_PIN_D6 BIT6 // P2.6
#define LCM_PIN_D5 BIT5 // P2.5
#define LCM_PIN_D4 BIT4 // P2.4
#define LCM_PIN_MASK ((LCM_PIN_RS | LCM_PIN_EN | LCM_PIN_D7 | LCM_PIN_D6 | LCM_PIN_D5 | LCM_PIN_D4))
#define FALSE 0
#define TRUE 1
//------------------------------------------------------------------------------
// PULSO
// Descripcion:
//
// Esta funcion debe ser llamada cada que el LCD necesite revisar el bus de datos
//
// Parametros:
// void.
//
// Retorna:
// void.
//
void PulseLcm()
{
// poner en bajo el bit EN (0)
LCM_OUT &= ~LCM_PIN_EN;
__delay_cycles(200);
// poner en alto el bit EN (1)
LCM_OUT |= LCM_PIN_EN;
__delay_cycles(200);
// poner en bajo el bit EN (0)nuevamente
LCM_OUT &= (~LCM_PIN_EN);
__delay_cycles(200);
}
//------------------------------------------------------------------------------
// ENVIO DE BYTES
// Descripcion:
//
// Envion de un byte por un bus de 4 bits, se envia en 2 partes
// primero el nible alto y despues el nible bajo
//
// Parametros:
// ByteToSend - Solo el byte para enviar
//
// IsData - TRUE si es un dato, FALSE si en un comando
//
// Retorno:
// void.
void SendByte(char ByteToSend, int IsData)
{
// limpiar todos los pines
LCM_OUT &= (~LCM_PIN_MASK);
// enviar el nible alto con una asignacion
LCM_OUT |= (ByteToSend & 0xF0);
if (IsData == TRUE)
{
LCM_OUT |= LCM_PIN_RS;
}
else
{
LCM_OUT &= ~LCM_PIN_RS;
}
PulseLcm();
// enviar nible bajo con una asignacion
LCM_OUT &= (~LCM_PIN_MASK);
LCM_OUT |= ((ByteToSend & 0x0F) << 4);
if (IsData == TRUE)
{
LCM_OUT |= LCM_PIN_RS;
}
else
{
LCM_OUT &= ~LCM_PIN_RS;
}
PulseLcm();
}
//------------------------------------------------------------------------------
// INICIALIZACION
// Descripcion:
// inicializa el LCD despues de apagar y encender.
//
// Nota: esta rutina no tiene que ser llamada siempre, solo cuando
// se apague el micro
// Parametros:
// void.
//
// Retorno:
// void.
//
void InitializeLcm(void)
{
//
// establecer configuracion de los pines
//
LCM_DIR |= LCM_PIN_MASK;
LCM_OUT &= ~(LCM_PIN_MASK);
//
// esperar a que el lcd inicialice
//
__delay_cycles(10000);
//
// inicializar el modulo lcd
//
// 1. establecer con 4 bits de entrada
//
LCM_OUT &= ~LCM_PIN_RS;
LCM_OUT &= ~LCM_PIN_EN;
LCM_OUT = 0x20;
PulseLcm();
// establecer 4 bits de entrda nuevamente (recomendado)
//
SendByte(0x28, FALSE);
// 2. Display encendido, cursor encendido y preparado
//
SendByte(0x0E, FALSE);
// 3. mover cursor
//
SendByte(0x06, FALSE);
}
//------------------------------------------------------------------------------
// LIMPIAR LCD
// Descripcion:
// limpia la pantalla y pone el cursor en el inicio
//
// Parametros:
// void.
//
// Regresa:
// void.
//
void ClearLcmScreen()
{
//limpiar display y regresar al origen
SendByte(0x01, FALSE);
SendByte(0x02, FALSE);
}
//-----------------------------------------------------------------------------
// IMPRIMIR TEXTO
// Descripcion:
// imprime una cadena de caracteres en la pantalla
//
// Parametros:
// Text - solo cadenas de caracteres ("esime")
//
// Retorna:
// void.
void PrintStr(char *Text)
{
char *c;
c = Text;
while ((c != 0) && (*c != 0))
{
SendByte(*c, TRUE);
c++;
}
}
//------------------------------------------------------------------------------
int main( void )
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
// BCSCTL1 |= XTS + DIVA0 + DIVA1; // cristal externo 8MHz/8=1Mhz
InitializeLcm();
ClearLcmScreen();
PrintStr("hola mundo");
while (1)
{
__delay_cycles(1000);
}
}