Hi everybody !
I wanna interface LCD 12864 with my launch pad, i am trying to interfacing, but something wrong with my code , could you please me to compile making operational with LCD. i am new with Tiva C Series Micros.
Here is my code:
//***************************************************************************** // // blinky.c - Simple example to blink the on-board LED. // // Copyright (c) 2013-2015 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // Texas Instruments (TI) is supplying this software for use solely and // exclusively on TI's microcontroller products. The software is owned by // TI and/or its suppliers, and is protected under applicable copyright // laws. You may not combine this software with "viral" open-source // software in order to form a larger program. // // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL // DAMAGES, FOR ANY REASON WHATSOEVER. // // This is part of revision 2.1.1.71 of the EK-TM4C1294XL Firmware Package. // //***************************************************************************** #include <stdint.h> #include "inc/tm4c1294ncpdt.h" #include <stdbool.h> #include "driverlib/sysctl.h" #include "driverlib/gpio.h" #include"inc/hw_types.h" #include"inc/hw_memmap.h" #include"driverlib/timer.h" #include"driverlib/interrupt.h" #include"driverlib/systick.h" //***************************************************************************** volatile uint32_t period,SysClk; void delay(void); int main(void) { //port intialization SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION); //DATA-SIGNALS GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE,GPIO_PIN_4|GPIO_PIN_5);//DB0,DB1 GPIOPinTypeGPIOOutput(GPIO_PORTH_BASE,GPIO_PIN_1);//DB2 GPIOPinTypeGPIOOutput(GPIO_PORTM_BASE,GPIO_PIN_4);//DB3 GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE,GPIO_PIN_4|GPIO_PIN_5);//DB4&DB5 GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE,GPIO_PIN_4|GPIO_PIN_5);//DB6, DB7 //CONTROL-SIGNALS GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,GPIO_PIN_4|GPIO_PIN_5);//RS,R/W GPIOPinTypeGPIOOutput(GPIO_PORTK_BASE,GPIO_PIN_2);//EN delay(); GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_4,0);//RS GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_5,0);//R/W GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_2,0);//EN GPIOPinWrite(GPIO_PORTH_BASE,GPIO_PIN_1,0);//DB2 GPIOPinWrite(GPIO_PORTM_BASE,GPIO_PIN_4,0);//DB3 //Function Set 0x30 to Data-bus GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_4|GPIO_PIN_5,0);//DB0,DB1 GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_4|GPIO_PIN_5,1);//DB4&DB5 GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_4|GPIO_PIN_5,0);//DB6, DB7 delay(); GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_2,1);//EN //low to high pulse delay(); GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_4,0);//RS GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_5,1);//R/W delay(); GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_2,0);//EN GPIOPinWrite(GPIO_PORTH_BASE,GPIO_PIN_1,0);//DB2 GPIOPinWrite(GPIO_PORTM_BASE,GPIO_PIN_4,0);//DB3 GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_4,1);//DB0, //0x41 sent to data GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_5,0);//DB1 GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_4|GPIO_PIN_5,0);//DB4&DB5 GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_4,1);//DB6, GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_5,0);//DB7 delay(); GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_4,1);//RS GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_2,1);//EN delay(); GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_4,1);//RS GPIOPinWrite(GPIO_PORTK_BASE,GPIO_PIN_2,0);//EN } void delay(void){ SysClk=SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |SYSCTL_OSC_MAIN|SYSCTL_USE_PLL|SYSCTL_CFG_VCO_480), 120000000); SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); TimerIntClear(TIMER0_BASE,TIMER_TIMA_TIMEOUT); TimerConfigure(TIMER0_BASE,TIMER_CFG_PERIODIC); period=SysClk/2; TimerLoadSet(TIMER0_BASE,TIMER_A,period-1); //TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT); TimerEnable(TIMER0_BASE, TIMER_A); while(!TimerIntStatus(TIMER0_BASE,false)){ } }
ST7920.pdf
i have also attached the lcd data sheet for reference , please.
thanks in advance