Example #1
0
/***********************************************************************
DESC:    Initializes LCD
INPUT: Nothing
RETURNS: Nothing
CAUTION: Uses timer 1 in delay functions
************************************************************************/
void LCD_Init(void)
{
  
  LCD_Write(COMMAND,function_set_8bit);   // 8-bit interface, 2 lines, 5x8 font
  DELAY_1ms_T1(10);
  LCD_Write(COMMAND,function_set_8bit);
  DELAY_1ms_T1(5);
  LCD_Write(COMMAND,function_set_8bit);
  DELAY_1ms_T1(1);
  LCD_Write(COMMAND,function_set_8bit|two_line|set_5x8);
  DELAY_1ms_T1(1);
  LCD_Write(COMMAND,display_control|display_on|cursor_off|blink_off);   // Display on, Cursor On and Not blinking
  DELAY_1ms_T1(1);
  LCD_Write(COMMAND,clear_display);   // Clear Display
  DELAY_1ms_T1(5);         // Must wait until this is complete
  LCD_Write(COMMAND,entry_mode|shift_right|cursor);   // DDRAM address increments with no scrolling
  DELAY_1ms_T1(1);

}
Example #2
0
main()
{
   uint8_t *memory1, *memory2;
   REDLED=0;
   AUXR=0x0c;   // make all of XRAM available, ALE always on
   if(OSC_PER_INST==6)
   {
       CKCON0=0x01;  // set X2 clock mode
   }
   else if(OSC_PER_INST==12)
   {
       CKCON0=0x00;  // set standard clock mode
   }
   uart_init();
   DELAY_1ms_T1(300);
   REDLED=1;
   memory1=code_memory_init();
   memory2=xdata_memory_init();

   print_memory(memory1, 41);
   putchar(CR);
   putchar(LF);
   print_memory(memory2, 42);
   putchar(CR);
   putchar(LF);
   LCD_Init();  
   Update_Line1();
   Update_Line2();
   while(1)
   {

	
	  

   } 
}
Example #3
0
void Update_Line2(void)
{
   LCD_Write(COMMAND,set_ddram_addr|line2);
   DELAY_1ms_T1(1);
   LCD_Print(12,Line2_string);
}
Example #4
0
void Update_Line2(uint8_t * line_string,uint8_t num_bytes)
{
   LCD_Write(COMMAND,set_ddram_addr|line2);
   DELAY_1ms_T1(1);
   LCD_Print(num_bytes,line_string);
}