first of all i have to clearify that
1. i am not a native speaker so please forgive any misspelling and wrong grammar
2. i am totally new to uC programming.
As a starter project i bought the msp-exp430fg4618 and downloaded the sample code concerning the LCD. My goal is to understand how the uC has to be programmed to work with the installed LCD. To do so i worked through the given sample code which can be found here http://www.ti.com/tool/msp-exp430fg4618 via the point 'get software'.
I also looked into the documentation of the MSP430FG4618, which is called MSP430x4xx Family UsersGuide (can be found here: http://www.ti.com/lit/pdf/slau056). I will refer to this guide as 'MSPUG' This is where i found quite detailed information about the LCD. I also looked up the data sheet of the installed LCD (http://www.softbaugh.com/downloads/SBLCDA4_Specification.pdf) to which I will refer as 'LCDUG'.
I hope this is enough basic information about my current situation.
Now my questions:
1. Is the following assumption correct?
The MSPUG on Page 749 table 26-2 shows the LCD memory in detail. It shows that LCDM1 can be found in address 091h, LCDM2 on 092h and so on. To my understanding the graphic in MSPUG p 731 fig 26-1 shows that the LCD memory LCDM1 is equivalent to something called SEG0 which is connected to S0. LCDM2 is connected to S1 and so on. Is this assumption correct?
The following question is somewhat related to question 1.
2. How is the LCD exactly wired to the uC?
MSPUG p. 747 shows connections between segments, pins and lcd memory. For instance: S0 is connected to pin0 and S1 is connected to pin1. Together they are used to program Digit1. The content of Digit1 is specified by the content of address 091h (=LCDM1?). Now my problem: LCDUG p.3 shows the segment mapping of the LCD. To my understanding Digit1 is specified by PIN13 and PIN14 - not PIN0 and PIN1. So if i want to get Digit1 to display an 'F' i would write 0101 to PIN13 and 0001 to PIN14 of the LCD. But how do I get this information to the LCD and what and where do I have to write this information into the memory of the uC? The sample code simply writes 0101 0001 into the adress 093h (I looked into the debugger to find this out) but refering to MSPUG p. 747 this adress should be connected to PIN5/6 so how does this work? I can not seem to understand the exact connection between uC lcd memory addresses and the LCDUG segment mapping. Please enlighten me.
3. How does the segment mapping, which is specified in LCDUG p.3, correspond to the memory usage of the uC?
I looked quite a bit into the sample code and the debugger. When the sample code tests the lcd it tries to show every possible character. The first character to be displayed is a Zero in Digit1. The code writes 5f to address 093h. As a binary code this is 1001 1111. When i check the LCDUG PIN13/14 a Zero should be obtained with a 0101 1111. I simply do not get how this works.
My last question is more general but since its about setting up the communication between lcd and uC i figured it would be best not to start a new thread.
4. Configuration of LCD
The sample file LCD.c configures the COM-Ports whith the following two lines
P5SEL |=(BIT4 | BIT3 | BIT2); P5DIR |=(BIT4 | BIT3 | BIT2);
The concerning documentation file MSP430xG461x DataSheet ( http://www.ti.com/litv/pdf/slas508i) on page 79 states that after using P5SEL.x = 1 the funtion P5DIR does not care whether its value is 0 or 1, thus the second line is completely useless or am i getting something totally wrong here?
I would be really glad if you could help me out. If I need to provide any further information please feel free to tell me.
With kind regards