Wednesday, January 16, 2019

What are the main Circuite in a thermal power plant?

There are four main circuits:
  • Feed water and steam flow circuit.
  • Coal and ash circuit.
  • Air and gas circuit.
  • Cooling water circuit.

Tuesday, January 8, 2019

Keypad interfacing with PIC microcontroller

Microcontroller: PIC18F452



MikroC Code:
unsigned short kp;
char txt[6];
char  keypadPort at PORTD;
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;
sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;
void main() 
{
  kp = 0;
  Keypad_Init();
  Lcd_Init();
  Lcd_Cmd(_LCD_CLEAR);
  Lcd_Cmd(_LCD_CURSOR_OFF);
  Lcd_Out(1, 2, "MH Instruments");
  Lcd_Out(2, 1, "Key Pressed:");

  do 
  {
  kp = Keypad_Key_Click();
    switch (kp)
     {                                                //transform key to it's ASCII value
      case  1: kp = 49; break; // 1
      case  2: kp = 50; break; // 2
      case  3: kp = 51; break; // 3
      case  4: kp = 52; break; // 4
      case  5: kp = 53; break; // 5
      case  6: kp = 54; break; // 6
      case  7: kp = 55; break; // 7
      case 8: kp = 56; break; // 8
      case 9: kp = 57; break; // 9
      case 10: kp = 42; break; // *
      case 11: kp = 48; break; // 0
      case 12: kp = 35; break; // #
    }
  Lcd_Chr(2, 14, kp);
  } while (1);
}