In project I used lcd from nokia 5110 (PCD8544 driver),
It is monochrome graphic lcd with resolution 84x48 pixels
In used ready hardware ( foto below )
and connected it into CC3200 LaunchPad ( schematic below )
Communication with lcd is done via SPI ( in one side mc->lcd )
I wrote software spi algorithm (code below )
void LcdSpiInit() { // Configure PIN_05 for GPIOOutput (SPI_CLK) MAP_PinTypeGPIO(PIN_05, PIN_MODE_0, false); MAP_GPIODirModeSet(SPI_CLK_PORT, SPI_CLK_PIN, GPIO_DIR_MODE_OUT); // Configure PIN_02 for GPIOOutput (SPI_MOSI) MAP_PinTypeGPIO(PIN_02, PIN_MODE_0, false); MAP_GPIODirModeSet(SPI_MOSI_PORT, SPI_MOSI_PIN, GPIO_DIR_MODE_OUT); GPIOPinWrite(SPI_CLK_PORT, SPI_CLK_PIN, SPI_CLK_PIN); } void SpiWriteByte(uInt8 data) { uInt8 idx, l_data; l_data = data; for(idx=0; idx<8; idx ++) { GPIOPinWrite(SPI_CLK_PORT, SPI_CLK_PIN, 0x00); if((l_data & 0x80) == 0x80) GPIOPinWrite(SPI_MOSI_PORT, SPI_MOSI_PIN, SPI_MOSI_PIN); else GPIOPinWrite(SPI_MOSI_PORT, SPI_MOSI_PIN, 0x00); MAP_UtilsDelay(DELAY_CLK_1_US); GPIOPinWrite(SPI_CLK_PORT, SPI_CLK_PIN, SPI_CLK_PIN); MAP_UtilsDelay(DELAY_CLK_1_US); l_data = l_data << 1; } }
In project I use lcd in text mode but mostly in graphic mode
I am printing: system init screens, weather icons, and weather forecast emoticons.
Bitmaps are designed in freeware software: micro LCD (in attachment)
( Firstly I wrote my own bmp converter, is somebody want I can share it )
Lcd usage procedures are witten in C:
void LcdInit() { GPIOPinWrite(PWR_PORT, PWR_PIN, PWR_PIN); // power on GPIOPinWrite(SCE_PORT, SCE_PIN, 0x00); // sce GPIOPinWrite(RES_PORT, RES_PIN, 0x00); // reset on // Delay to keep printing speed reasonable. About 100 milliseconds. MAP_UtilsDelay(800000); GPIOPinWrite(RES_PORT, RES_PIN, RES_PIN); // reset off GPIOPinWrite(SCE_PORT, SCE_PIN, SCE_PIN); // sce LcdWriteCommand( 0x21 ); // LCD Extended Commands. LcdWriteCommand( 0xC8 ); // Set LCD Vop (Contrast). LcdWriteCommand( 0x06 ); // Set Temp coefficent. LcdWriteCommand( 0x13 ); // LCD bias mode 1:48. LcdWriteCommand( 0x20 ); // LCD Standard Commands, Horizontal addressing mode. LcdWriteCommand( 0x08 ); // LCD blank LcdWriteCommand( 0x0C ); // LCD in normal mode. }
Full code is available in attachment
In one with my previous posts I share LCD usage video,
Here is a link ( soon now I have problem with add a links )
best regards
Lukasz, Poland