Skip to main content
Post Undeleted by Electrone
Post Deleted by Electrone
added 327 characters in body
Source Link
void LCD_init(void)
    {
    
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      //Delay_Us(100);
      lcd_cmd(0x28);
      HAL_Delay(20);
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x0c);            // Make cursorinvisible
       lcd_Clear();            // Clear screen
       lcd_cmd(0x6);            // Set entry Mode(auto increment of cursor)
    }
    
    oid lcd_cmd(__uint16_t cmd)
    {       GPIOB->ODR =0;
            HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_RESET);
            cmd = (cmd << 8) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            cmd = (cmd << 4) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            GPIOB->ODR =0;
    }
    
    
    void lcd_data(__uint16_t lcd_data)
    {     GPIOB->ODR =0x0000;
        // HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_SET);
         lcd_data = (lcd_data << 8) ;
         GPIOB->ODR =  (lcd_data& 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
         lcd_data = (lcd_data << 4) ;
         GPIOB->ODR =  (lcd_data & 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
    }
    
    
    void lcd_Clear(void)
    {
        lcd_cmd(0x01);
        HAL_Delay(5);
    }
    
    void lcd_String(const char *ptr)  // ptr pointing the address of displaying string
    {
        while (*ptr)             // check weather the endo of file then exit the loop
        {
            lcd_data(*ptr++);    // Sending data to LCD_data functions
        }
    } 



 void lcd_Strobe(void)
{

    HAL_GPIO_WritePin(GPIOB,GPIO_PIN_11, GPIO_PIN_SET);// LCD Enable PIN to High
   // HAL_Delay(1);
    //Delay_Us(100);
    HAL_GPIO_WritePin(GPIOB,EN_Pin, RESET);// LCD Enable High to Low
    //Delay_Us(100);PIO_PIN_11
   // HAL_Delay(1);
 }
void LCD_init(void)
    {
    
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      //Delay_Us(100);
      lcd_cmd(0x28);
      HAL_Delay(20);
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x0c);            // Make cursorinvisible
       lcd_Clear();            // Clear screen
       lcd_cmd(0x6);            // Set entry Mode(auto increment of cursor)
    }
    
    oid lcd_cmd(__uint16_t cmd)
    {       GPIOB->ODR =0;
            HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_RESET);
            cmd = (cmd << 8) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            cmd = (cmd << 4) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            GPIOB->ODR =0;
    }
    
    
    void lcd_data(__uint16_t lcd_data)
    {     GPIOB->ODR =0x0000;
        // HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_SET);
         lcd_data = (lcd_data << 8) ;
         GPIOB->ODR =  (lcd_data& 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
         lcd_data = (lcd_data << 4) ;
         GPIOB->ODR =  (lcd_data & 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
    }
    
    
    void lcd_Clear(void)
    {
        lcd_cmd(0x01);
        HAL_Delay(5);
    }
    
    void lcd_String(const char *ptr)  // ptr pointing the address of displaying string
    {
        while (*ptr)             // check weather the endo of file then exit the loop
        {
            lcd_data(*ptr++);    // Sending data to LCD_data functions
        }
    }
void LCD_init(void)
    {
    
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      //Delay_Us(100);
      lcd_cmd(0x28);
      HAL_Delay(20);
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x0c);            // Make cursorinvisible
       lcd_Clear();            // Clear screen
       lcd_cmd(0x6);            // Set entry Mode(auto increment of cursor)
    }
    
    oid lcd_cmd(__uint16_t cmd)
    {       GPIOB->ODR =0;
            HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_RESET);
            cmd = (cmd << 8) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            cmd = (cmd << 4) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            GPIOB->ODR =0;
    }
    
    
    void lcd_data(__uint16_t lcd_data)
    {     GPIOB->ODR =0x0000;
        // HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_SET);
         lcd_data = (lcd_data << 8) ;
         GPIOB->ODR =  (lcd_data& 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
         lcd_data = (lcd_data << 4) ;
         GPIOB->ODR =  (lcd_data & 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
    }
    
    
    void lcd_Clear(void)
    {
        lcd_cmd(0x01);
        HAL_Delay(5);
    }
    
    void lcd_String(const char *ptr)  // ptr pointing the address of displaying string
    {
        while (*ptr)             // check weather the endo of file then exit the loop
        {
            lcd_data(*ptr++);    // Sending data to LCD_data functions
        }
    } 



 void lcd_Strobe(void)
{

    HAL_GPIO_WritePin(GPIOB,GPIO_PIN_11, GPIO_PIN_SET);// LCD Enable PIN to High
   // HAL_Delay(1);
    //Delay_Us(100);
    HAL_GPIO_WritePin(GPIOB,EN_Pin, RESET);// LCD Enable High to Low
    //Delay_Us(100);PIO_PIN_11
   // HAL_Delay(1);
 }
edited body
Source Link

enter image description hereenter image description here

enter image description here

enter image description here

deleted 18 characters in body
Source Link
toolic
  • 9.8k
  • 9
  • 27
  • 35
`

void LCD_init(void)
    {
    
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      //Delay_Us(100);
      lcd_cmd(0x28);
      HAL_Delay(20);
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x0c);            // Make cursorinvisible
       lcd_Clear();            // Clear screen
       lcd_cmd(0x6);            // Set entry Mode(auto increment of cursor)
    }
    
    oid lcd_cmd(__uint16_t cmd)
    {       GPIOB->ODR =0;
            HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_RESET);
            cmd = (cmd << 8) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            cmd = (cmd << 4) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            GPIOB->ODR =0;
    }
    
    
    void lcd_data(__uint16_t lcd_data)
    {     GPIOB->ODR =0x0000;
        // HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_SET);
         lcd_data = (lcd_data << 8) ;
         GPIOB->ODR =  (lcd_data& 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
         lcd_data = (lcd_data << 4) ;
         GPIOB->ODR =  (lcd_data & 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
    }
    
    
    void lcd_Clear(void)
    {
        lcd_cmd(0x01);
        HAL_Delay(5);
    }
    
    void lcd_String(const char *ptr)  // ptr pointing the address of displaying string
    {
        while (*ptr)             // check weather the endo of file then exit the loop
        {
            lcd_data(*ptr++);    // Sending data to LCD_data functions
        }
    }

`
`

void LCD_init(void)
    {
    
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      //Delay_Us(100);
      lcd_cmd(0x28);
      HAL_Delay(20);
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x0c);            // Make cursorinvisible
       lcd_Clear();            // Clear screen
       lcd_cmd(0x6);            // Set entry Mode(auto increment of cursor)
    }
    
    oid lcd_cmd(__uint16_t cmd)
    {       GPIOB->ODR =0;
            HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_RESET);
            cmd = (cmd << 8) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            cmd = (cmd << 4) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            GPIOB->ODR =0;
    }
    
    
    void lcd_data(__uint16_t lcd_data)
    {     GPIOB->ODR =0x0000;
        // HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_SET);
         lcd_data = (lcd_data << 8) ;
         GPIOB->ODR =  (lcd_data& 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
         lcd_data = (lcd_data << 4) ;
         GPIOB->ODR =  (lcd_data & 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
    }
    
    
    void lcd_Clear(void)
    {
        lcd_cmd(0x01);
        HAL_Delay(5);
    }
    
    void lcd_String(const char *ptr)  // ptr pointing the address of displaying string
    {
        while (*ptr)             // check weather the endo of file then exit the loop
        {
            lcd_data(*ptr++);    // Sending data to LCD_data functions
        }
    }

`
void LCD_init(void)
    {
    
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      lcd_cmd(0x30);
      HAL_Delay(20);
      //Delay_Us(100);
      lcd_cmd(0x28);
      HAL_Delay(20);
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
       lcd_cmd(0x0c);            // Make cursorinvisible
       lcd_Clear();            // Clear screen
       lcd_cmd(0x6);            // Set entry Mode(auto increment of cursor)
    }
    
    oid lcd_cmd(__uint16_t cmd)
    {       GPIOB->ODR =0;
            HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_RESET);
            cmd = (cmd << 8) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            cmd = (cmd << 4) ;
            GPIOB->ODR =  (cmd & 0xf000);
            lcd_Strobe();
            GPIOB->ODR =0;
    }
    
    
    void lcd_data(__uint16_t lcd_data)
    {     GPIOB->ODR =0x0000;
        // HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_SET);
         lcd_data = (lcd_data << 8) ;
         GPIOB->ODR =  (lcd_data& 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
         lcd_data = (lcd_data << 4) ;
         GPIOB->ODR =  (lcd_data & 0xf000)|0x400;
         lcd_Strobe();
         GPIOB->ODR =0;
    }
    
    
    void lcd_Clear(void)
    {
        lcd_cmd(0x01);
        HAL_Delay(5);
    }
    
    void lcd_String(const char *ptr)  // ptr pointing the address of displaying string
    {
        while (*ptr)             // check weather the endo of file then exit the loop
        {
            lcd_data(*ptr++);    // Sending data to LCD_data functions
        }
    }
added 240 characters in body
Source Link
Loading
added 212 characters in body
Source Link
winny
  • 16.8k
  • 6
  • 50
  • 71
Loading
Source Link
Loading