Jump to content
43oh

Tauronts

Members
  • Content Count

    7
  • Joined

  • Last visited

Posts posted by Tauronts

  1. Maybe for my next projects I could use this. But as soon as I already have the LCD here I would like to at least make it work.

    Anyways, I'll look for this OLED display the same way as I was looking for a Nokia display. Thank you for the advice.

  2. 1) There's one 5V pin to feed the display, the GPIOs must be operated as 5V also??

    2) This is a little bit outdated code, I got to flick some LEDs after I added a command that takes down the high impedance on the GPIOs, I`ll try to get it here as soon as I get to use the desktop.

    3) I don`t have an oscilloscope or a data analyzer, I`ll try to use one on my school. Anyways I am going to read throught the MSP datasheet all the way to see if I can find this.

     

    Thanks for the reply man.

    I will try to keep this post up to date so others can use this info.

  3. 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
      }

     

  4. This code below is needed to work with the new MSP430FR2433?
    If so, where do I put it?

    Sorry for the inconvenience, I have just bought as my first MSP, before I had just tried some of the MSPG2553.

    On 08/11/2017 at 6:02 PM, Rickta59 said:
    
    #define __MSP430_HAS_MSP430XV2_CPU__                /* Definition to show that it has MSP430XV2 CPU */
    #define __MSP430_HAS_ADC__                    /* Definition to show that Module is available */
    #define __MSP430_HAS_ADC_CHANNELS_8__
    #define __MSP430_HAS_BKMEM__                  /* Definition to show that Module is available */
    #define __MSP430_HAS_BACKUP_RAM__                /* Legacy module name */
    #define __MSP430_HAS_CRC__                    /* Definition to show that Module is available */
    #define __MSP430_HAS_CS__                     /* Definition to show that Module is available */
    #define __MSP430_HAS_FRAM__                   /* Definition to show that Module is available */
    #define __MSP430_HAS_GC__                     /* Definition to show that Module is available */
    #define __MSP430_HAS_MPY32__                  /* Definition to show that Module is available */
    #define __MSP430_HAS_PMM_FRAM__                /* Definition to show that Module is available */
    #define __MSP430_HAS_PORT1_R__                /* Definition to show that Module is available */
    #define __MSP430_HAS_PORT2_R__                /* Definition to show that Module is available */
    #define __MSP430_HAS_PORTA_R__                /* Definition to show that Module is available */
    #define __MSP430_HAS_P1SEL0__                 /* Define for DriverLib */
    #define __MSP430_HAS_P2SEL0__                 /* Define for DriverLib */
    #define __MSP430_HAS_PASEL0__                 /* Define for DriverLib */
    #define __MSP430_HAS_P1SEL1__                 /* Define for DriverLib */
    #define __MSP430_HAS_P2SEL1__                 /* Define for DriverLib */
    #define __MSP430_HAS_PASEL1__                 /* Define for DriverLib */
    #define __MSP430_HAS_PORT3_R__                /* Definition to show that Module is available */
    #define __MSP430_HAS_PORTB_R__                /* Definition to show that Module is available */
    #define __MSP430_HAS_P3SEL0__                 /* Define for DriverLib */
    #define __MSP430_HAS_PBSEL0__                 /* Define for DriverLib */
    #define __MSP430_HAS_P3SEL1__                 /* Define for DriverLib */
    #define __MSP430_HAS_PBSEL1__                 /* Define for DriverLib */
    #define __MSP430_HAS_RTC__                    /* Definition to show that Module is available */
    #define __MSP430_HAS_SFR__                    /* Definition to show that Module is available */
    #define __MSP430_HAS_SYS__                    /* Definition to show that Module is available */
    #define __MSP430_HAS_FRWPPW__                 /* Definition to show that Function is available */
    #define __MSP430_HAS_DATA_FRWP__                /* Definition to show that Function is available */
    #define __MSP430_HAS_ADC_PCTLSEL__                /* Definition to show that Function is available */
    #define __MSP430_HAS_T0A3__                   /* Definition to show that Module is available */
    #define __MSP430_HAS_T1A3__                   /* Definition to show that Module is available */
    #define __MSP430_HAS_T2A2__                   /* Definition to show that Module is available */
    #define __MSP430_HAS_T3A2__                   /* Definition to show that Module is available */
    #define __MSP430_HAS_EUSCI_A0__                /* Definition to show that Module is available */
    #define __MSP430_HAS_EUSCI_A1__                /* Definition to show that Module is available */
    #define __MSP430_HAS_EUSCI_B0__                /* Definition to show that Module is available */
    #define __MSP430_HAS_WDT_A__                  /* Definition to show that Module is available */
    #define __MSP430_HAS_TLV__                    /* Definition to show that Module is available */

     

     

  5. E ai galera, outros Brasileiros comenta ai pra nós trocarmos informação sobre o ENERGIA

    ____________________________________________________________
    Hello guys, comment here so we can exchange some info about ENERGIA

×
×
  • Create New...