While working on the PCB, I realised one thing. I haven't found a display yet! (Pretty useful!) There is a challenge here, the MSP430FR5739 being used does not have a built in LCD module, so any solution will have to be in software or using a different interface. The best option for me here will be to use the I2C interface for a couple of reasons. The first being SPI, I have rarely used this interface, and while MSP430ware does provide some nice functions for it, if possible I'd like to keep the SPI connection dedicated to the WiFi for simplicity when it comes to debugging. Second is the number of GPIO used for it. At last count, this was slowly running out, while this count be changed by adding something like a 595 IC to handle the LEDs in the system and cut down the GPIO being used, it is not entirely necessary right now. Thirdly, I'm going by the Stick to what you know method for these parts and as it happens I have used I2C before. With the addition of the MSP430ware API, there shouldn't be too many problems. This should remove the need to find or write/port a library to handle a HD4470 compatible LCD controller.
With this in mind, time to go have a look through the element14/Farnell store for possible options. A quick search brings up options such as MIDAS - MCCOG21605C6W-BNMLWI - LCD, COG 2X16, NEG STN, W B/L, I2CMIDAS - MCCOG21605C6W-BNMLWI - LCD, COG 2X16, NEG STN, W B/L, I2C This particular LCD comes with a very good datasheet (Something some products lack). At present however, all I have is BATRON - BTHQ21605V-COG-FSRE-I2C - LCD MODULE, ALPHANUMERIC, 2X16BATRON - BTHQ21605V-COG-FSRE-I2C - LCD MODULE, ALPHANUMERIC, 2X16, so lets see how that goes. On a side note, the Batron LCD has two possible addresses, 0111 010 and 0111 011. (First time I used it, this one stumped me. The address certainly isn't listed in the Batron datasheet which is really quite frustrating!
Getting the LCD to display things shouldn't be too hard, the MSP430ware API document has a good example to get you going.
#define SLAVE_ADDRESS 0111010 //Initialize Master eI2C_masterInit(__MSP430_BASEADDRESS_EUSCI_B0__, eI2C_CLOCKSOURCE_SMCLK, //UCS_getSMCLK(__MSP430_BASEADDRESS_UCS__), 1000000, eI2C_SET_DATA_RATE_400KBPS, 1, eI2C_NO_AUTO_STOP ); //Slave address eI2C_setSlaveAddress(__MSP430_BASEADDRESS_EUSCI_B0__, SLAVE_ADDRESS ); //Set in transmit mode eI2C_setMode(__MSP430_BASEADDRESS_EUSCI_B0__, eI2C_TRANSMIT_MODE ); //Enable I2C Module to start operations eI2C_enable(__MSP430_BASEADDRESS_EUSCI_B0__); //Send single byte data. eI2C_masterSendSingleByte(__MSP430_BASEADDRESS_EUSCI_B0__, transmitData ); //Delay until transmission completes while (eI2C_isBusBusy(__MSP430_BASEADDRESS_EUSCI_B0__)) ;
I do find one thing annoying about MSP430ware however. The API user guide is a little...sparse when it comes to function descriptions. In order to get the arguments for a function you need to refer to the API header files. They are simply not listed in the PDF. While not a huge problem, it can be a little frustrating to have to switch between more documents than necessary in order to understand an example.
Should this LCD not work (Rather likely if a previous project is anything to do by), something different will have to be dreamed up. LED digit display with a cunning bit of paper describing the meaning may work until something else comes up. Time to research implementing a 595 I think! Also on the cards this week is finalising the shopping list for motor control and LED drivers. If you have any suggestions for these, please leave a comment!