This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to use LCD pin as digital I/O?

Other Parts Discussed in Thread: MSP430F437, MSP430F449

Hello,

I want to use some LCD pin of MSP430, as digital I/O type.  I have to add one more digital interface, but other digital I/O is already in use for other purpose. And for price/heritage reason, I can't choose another MSP430 MCU.

So I read datasheet/user guide of MSP430, then found it is available. At that document, LCD PIn can work as digital I/O, by "LCDPx" bit set-up. But there's no more information.

I just tried to do that, with IAR C compiler  and MSP430 FET device. Following is brief code for that.

{{{ Test code

  LCDCTL &= 0x02;

  delay(1000);

  char* LCD = LCDMEM;

  for (i=0; i<20; i++)
    {
      LCD[i] = 0xFF;
    }

}}}

Build, Program Download to MSP430, and other works was completed fine. But there's no change on LCD pin.

I searched web for days, but can't find any clue of it.

So, what can I do to use LCD pin like a GPIO?

  • Which MSP430 chip? There are about 100 different ones!

  • Thank you for reply.

    I'm using MSP430F437, :)

  • Simon said:

    Hello,

    I want to use some LCD pin of MSP430, as digital I/O type. 

     

    This is not possible, since the LCD pins output analog signal waveforms. All in all you cannot have a controlled high or low other than a PWM square wave of fixed frequency and duty cycle.

    Unfortunately in the MSP430, I/O pins have to be multiplexed with the segment lines to be used one over the other. In your case since you want to use as a General purpose input, you have to see the waveforms coming out of it under static operation. I have looked at the waveform under static mode, it looks like a plain square wave with 50 % duty cycle similar to the one described in the User's Guide (Pg 678)

  • Take a look at MSP430F437 data-sheet pin designation section. There are 48 pins pins named Px.y / .., (where x is 1,2,3,4,5, or 6; y is 0,1,2,3,4,5,6, or 7; the / means "can also be used as"; and ... is some other signal names). There are 6x8=48 such pins. The can all be used as GPIO pins Px.y.  Some of these 48 pins with ... include LCD signal names can also be used as LCD pins. Some of these 48 pins can be use for other functions as indicated by other signal names in the ...

    These multifunction pins can only be use as one of the function at a time. See data-sheet input/output schematics section for details.

    Usually, you set PxSEL.y = 0 to select the corresponding pin as GPIO. (In some cases, there may be additional settings that are required.) You set PxDIR.y = 0 for input through PxIN.y ; or set PxDIR.y =1 for output through PxOUT.y

     

  • Brandon said:

    ... This is not possible, since the LCD pins output analog signal waveforms. All in all you cannot have a controlled high or low other than a PWM square wave of fixed frequency and duty cycle....

     

    Brandon,

    While I agree with you that LCD signals cannot be used as digital I/O signals, I am not sure what LCD pins in the original post mean.

    For example, is P5.4/COM3 pin one of the LCD pins?

    If the user is using 4-mux LCD, he must use that pin for LCD COM3 signal and cannot use it as P5.4. But if he is using 3-mux, 2-mux, 1-mux, or no LCD, that pin can be used as P5.4

    -OCY

  • old_cow_yellow said:

    ... This is not possible, since the LCD pins output analog signal waveforms. All in all you cannot have a controlled high or low other than a PWM square wave of fixed frequency and duty cycle....

     

    Brandon,

    While I agree with you that LCD signals cannot be used as digital I/O signals, I am not sure what LCD pins in the original post mean.

    For example, is P5.4/COM3 pin one of the LCD pins?

    -OCY

    [/quote]

    OCY: You are correct. I should have clarified that the LCD pins I was referring to are the "dedicated" LCD-only pins. Any pin with a GPIO mulitplexed functionality can certainly be used a GPIO :)

  • Thank you for your comment, Brandon and OCY.

    The LCD pin, which I want to use, is S0~S39. That is pin for LCD only, I think.

    So, I have to find another not-used pin, named PX.X.

     

    Thank you.

  • Some of the S0~S39 pins are dual-propose and can be used for Px.y too. This depends on the package type of F437.

    If you LDC pannel does not need all 40 Segment pins, you should use the dedicated LCD Segment pins for LCD and leave some of the dual-propose pins for other propose.

  • Hello, I configured unused LCD segments as digital I/O several times. This was easily done and well documented and operating fine with first OTP MSP430 devices, such as the MSP430P337. All you needed was to set the control register by turning on the LCDON bit et the LCDSegment bit. LCDPx had to be set to 0. LCDMx is then not relevant. You could then just write the following instruction :
    MOV.B #005h,&LCDCTL.
    Then if you needed to set high O2/S2, just write :
    BIS.B #O2,&LCD2 ;
    to set the segment low just write
    BIC.B #O2,&LCD2 ;Also don't forget to declare :
    O2 equ 00fh ;
    LCD2 equ 092h;
    That'it!
    With the advent of flash MSP430 device, such as the MSP430F449, it seems this possiblity is of operation mode is not longer available or is not operating well. I tried it and found out that the output was not switching completely to high or low states. This may be due to current sink ou source problems. Actually, this is a question I am asking as well because the SLAU056L user's guide is no longer speaking about this possibility of turning unused LCD segments as digital I/O. Comparatively you could find such explanations in the MSP430x3xx familly user's guide. Read chapter 14.
    Regards,
  • How to set up each multi-function pins for each specific function is described in the APPLICATION INFORMATION section of the data-sheet.

**Attention** This is a public forum