Thursday, 24 November 2016

Embedded Systems Training in Pune

Embedded Systems Training in Pune
Embedded Systems Training in Pune



Technoscripts is best Embedded training institute in pune for quality training & good placement track for freshers as well as working professionals. 

NEW BATCH IS STARTING SOON!!
CONFIRM YOUR SEATS

To know more about TechnoScripts Click 
http://www.technoscripts.in/

For registration click 
http://www.technoscripts.in/contact-us-technoscripts-pune/

Or call on- 020-41217199 / 8605006788 / 7058132562

 

Thursday, 13 October 2016

Introduction to PIC micro-controller

Introduction to PIC (Click here)
PIC micro-controllers are popular processors developed by Microchip Technology with built-in RAM, memory, internal bus, and peripherals that can be used for many applications. PIC originally stood for “Programmable Intelligent Computer” but is now generally regarded as a “Peripheral Interface Controller”.
Types of PICs

PIC microcontrollers are broken up into two major categories: 8-bit microcontrollers and 16-bit microcontrollers. Each category is further subdivided into product families as shown in the following table:
8-bit MCU Product Family              16-bit MCU Product Family
             PIC10                                             PIC24F
             PIC12                                             PIC24H
             PIC14                                             dsPIC30
             PIC16                                             dsPIC33
             PIC18
The micro-controllers in the PIC10 through PIC14 families are considered low-end micro-controllers. PIC micro-controllers in the PIC16 and PIC18 families are considered mid-level micro-controllers while 16-bit PICs are considered high-end micro-controllers.
Each PIC has unique features and subtle differences. The correct choice for your project depends on many factors:
 Does the project require analog input or output?
 Does the project require digital input or output?
 How many I/O pins are required?
 Does the project require precise timing?
 How much memory does the project require?
 Is serial I/O required?
 Etc.

For more information on PIC click here

PICs also come in several types of packages: 
 Plastic Dual Inline Package (PDIP)
 Small-Outline Transistor (SOT)
 Dual Flat No-lead (DFN)
 Mini Small Outline Package (MSOP)
 Thin Quad Flat Pack (TQFP)
 Plastic Leaded Chip Carrier (PLCC)
 CERamic QUADpack (CERQUAD)
The reason for the number of packages is that there are some PICs with 100 I/O pins! The microcontrollers are basically rectangular or square shaped. The easiest package to work with is DIP or PDIP because it is easily breadboard-able and can easily be soldered.

Wednesday, 12 October 2016

embedded training in pune



An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts.Embedded systems control many devices in common use today.






What is a Microcontroller?
A Microcontroller is a programmable digital processor with necessary peripherals. Both microcontrollers and microprocessors are complex sequential digital circuits meant to carry out job according to the program / instructions. Sometimes analog input/output interface makes a part of microcontroller circuit of mixed mode(both analog and digital nature).

 Microcontrollers Vs Microprocessors
1. A microprocessor requires an external memory for program/data storage. Instruction execution requires movement of data from the external memory to the microprocessor or vice versa. Usually, microprocessors have good computing power and they have higher clock speed to facilitate faster computation.
2. A microcontroller has required on chip memory with associated peripherals. A microcontroller can be thought of a microprocessor with inbuilt peripherals.
3. A microcontroller does not require much additional interfacing ICs for operation and it functions as a stand alone system. The operation of a microcontroller is multipurpose, just like a Swiss knife.
4. Microcontrollers are also called embedded controllers. A microcontroller clock speed is limited only to a few tens of MHz. Microcontrollers are numerous and many of them are application specific.

Saturday, 2 July 2016

ADC program

int main(void)
{
int val=0;
 
ClcdInit();

Uart0Init(); // Initialize UART module at 9600 bps
        DelayMs(10500);
ClcdClear() ;
ClcdGoto(2,1);
ClcdPutS_P("Welcome");

_DelayMs(30050); //A delay of 1 second
ClcdClear();

 
while(1)
{
ClcdGoto(2,1);
ClcdPutS_P("Current Stop is");
_DelayMs(1000);
ClcdGoto(2,2);
ClcdPutS_P("lonavala");
_DelayMs(2000);
ClcdClear();

Uart0PutS("Bus No:MH12 777") ;
_DelayMs(500);
Uart0PutS("Via express highway") ;
_DelayMs(500);
 Uart0PutS("TIME:10:10A");
_DelayMs(500);
_DelayMs(500); //A lil delay
} // End While
}  // End main


void _DelayMs(unsigned int count)
{
     unsigned int j,k;
    for (j=0;j<count;j++)
{
        for (k=0;k<6000;k++)
{
            __asm
{
                nop;
                nop;
            }
        }
    }
}

void Uart0Init (void)    // Initialize Serial Interface      
{                
  PINSEL0 |= 0x00000005;           //Enable RxD0 and TxD0                  
    U0LCR = 0x83;                   // 8 bits, no Parity, 1 Stop bit          
    U0DLL = 97;                     // 9600 Baud Rate @ 15MHz VPB Clock        
    U0LCR = 0x03; // DLAB = 0
}


void  Uart0PutS(unsigned char *str) //A function to send a string on UART0
{
   while(*str)
   {
      Uart0PutCh(*str++);  
   }
}


void Uart0PutCh (unsigned char ch)   // Write character to Serial Port  
{                  
   while (!(U0LSR & 0x20));
  U0THR = ch;
}


unsigned char Uart0GetCh (void) // Read character from Serial Port  
{          
  while (!(U0LSR & 0x01));
  return (U0RBR);
}

  void ClcdInit(void)
{
    IODIR0 |= (unsigned long)(DATA_PORT); //initialize D4:D7 pins as output
    IODIR0 |= ((unsigned long)(1)<<CTRL_RS); //initialize RS pins as output
    IODIR0 |= ((unsigned long)(1)<<CTRL_EN); //initialize EN pins as output  
    _CLEAR_EN();                             //clear EN
    _CLEAR_RS();                             //clear RS
    _ClcdDelayMs(300);
    ClcdSendByte(0X03,0);       //Configure bus width as 8-bit
    _ClcdDelayMs(50);
    ClcdSendByte(0X02,0);       //Configure bus width as 4-bit, 1 line,5X7 dots
    _ClcdDelayMs(50);
    ClcdSendByte(0X28,0);       //Configure bus width as 4-bit, 2 line,5X7 dots
    _ClcdDelayMs(50);
    ClcdSendByte(0X10,0);       //Cursor move and Shift to left
    _ClcdDelayMs(1);
    ClcdSendByte(0x0D,0);       // DisplayOn,CursorOff
    _ClcdDelayMs(1);
    ClcdSendByte(0x06,0);       // EntryMode,Automatic Increment - No Display shift.
    _ClcdDelayMs(1);  
    ClcdSendByte(0x01,0);       //Clear Display and set address DDRAM with 0X00
    _ClcdDelayMs(5);
}


void ClcdSendByte(unsigned char byte,unsigned char type)
{
    _CLEAR_EN();
    if(type==_TYPE_DATA)
{
        _SET_RS();      // Selects data Register for read / write  
    }  
    else if(type==_TYPE_CMD)
{
        _CLEAR_RS();    // Selects cmd  Register for write
    }  
   
_ClcdDelay45Us();

    IOCLR0 |= DATA_PORT; //Clear Data Port
    IOSET0 |= ((((unsigned long)byte >> 4) & 0x0F)<<D4);//Send byte to Data port  
_EnToggle();
_ClcdDelay45Us();

    IOCLR0 |= DATA_PORT; //Clear Data Port
    IOSET0 |= (((unsigned long)byte & 0x0F)<<D4); //Send byte to Data port  
_EnToggle();                              
_ClcdDelay45Us();                            

}

void ClcdPutS_P( char *str)
{
    while(*str) //Check for valid character  
{                
        ClcdSendByte(*str++,_TYPE_DATA);//Send out the current byte pointed to
    }
}

Raspberry Training

void ClcdGoto(unsigned char x,unsigned char y)
{
    switch(y)
{
        case 1:
            // position for line 1
            y=0x80 ;
            break;
           
        case 2:
            // position for line 2
            y=0xC0 ;
            break;
           
     
           
        default:
            break;          
    }
    ClcdSendByte((x-1+y),_TYPE_CMD);
}

void _ClcdDelayMs(unsigned int count)
{
    volatile unsigned int j,k;
    for (j=0;j<count;j++)
{
        for (k=0;k<400;k++)
{
            __asm
{
                nop;
                nop;
            }
        }

void _ClcdDelay45Us(void)
{
volatile unsigned int k;
for(k=0;k<409;k++)
{
            __asm
{
                nop;
            }
}
}

GPS & GSM Tracking



#include <LPC214x.h>
#include "lcd.h"

/* ADC Macros */

#define ANALOG_IN   (1<<28) //Assign Analog In to P0.28  
#define ANALOG_IN_DIR  (1<<24) //Assign Direction register bits
#define ANALOG_IN1 (1<<29)
#define ANALOG_IN1_DIR (1<<26)
#define ANALOG_IN2   (1<<30)
#define ANALOG_IN2_DIR   (1<<28)


#define _PDN_BIT 1<<21
#define _ADCR_START_MASK 7<<24
#define _ADCR_SEL_MASK 0x000000FF
#define _ADC0_START 1<<24


/* GPS Macros */
#define RDR      0x01
#define THRE     0x20
#define RDA      0x04
#define _9600_12_MHZ  78 //approximate
#define _9600_15_MHZ  97

#define UART0_CH_NUM   6 // dont change thiss
#define VIC_UART0_CH   (0x01 << UART0_CH_NUM) //don't change thiss
#define VIC_INT_CH_EN   (0x01 << 5) //don't change thiss

#define UART1_CH_NUM   7 // dont change thiss
#define VIC_UART1_CH   (0x01 << UART1_CH_NUM) //don't change thiss
long num1,num2,num3,num4;

/* ADC Prototypes */
void Adc0Init(unsigned char clkdiv);
unsigned int Adc0Read(unsigned char channel);

/* UART Prototypes */
void Uart0Init (void);
void Uart0PutCh (unsigned char ch);
void  Uart0PutS(unsigned char *str);
void  SendHexData0(unsigned char *str0, int StrLenCntr0);
void Uart1PutCh (unsigned char ch);
unsigned char Uart1GetCh (void);
void  Uart1PutS(unsigned char *str);
void  SendHexData1(unsigned char *str1, int StrLenCntr1);
void _DelayMs(unsigned int count);

/* Variables */
char  stcol, endcol, j ;
//int val1,val2;
int temp,humidity,IR;
char END[1] = {26};
char SendingText1[6] = {'I','0','0','0',0x0D,0x0A};
char SendingText2[6] = {'T','0','0','0',0x0D,0x0A};
char SendingText3[6] = {'H','0','0','0',0x0D,0x0A};

int localADC0Data = 0;
int localADC1Data = 0;
int localADC2Data = 0;
int localADC3Data = 0;
unsigned char str4[]  = {"                 "};
char InChar;
char RecWordsP1[60];
int RecWordsCntrP1 = 0;
char RecChar_Int;
char CurrReChar;
char PrevReChar;
int GGAFound = 0;
char WorkingString[50];
int WorkStrWordCnt = 0;
unsigned char CopyTheSring[40];
int FillChar;
//*******************End of Private Protoype************************************

//*****************************************************************************
// Function:        int main(void)
//
// Input:           None
//
// Output:          None
//
// Overview:        Main enrty point.
//
// Note:            None
//*****************************************************************************
int main(void)
{

int flag1=0;
int flag2=0;
int flag3=0;
int flag4=0;

 
/* ADC initialization */


PINSEL1 |= ANALOG_IN_DIR;
IODIR0 &= ~(ANALOG_IN);
Adc0Init(10);  

  PINSEL1 |=  ANALOG_IN1_DIR;
IODIR0 &= ~(ANALOG_IN1);
Adc0Init(10);

PINSEL1 |= ANALOG_IN2_DIR;
IODIR0 &= ~(ANALOG_IN2);
Adc0Init(10);

 

Uart0Init();

 
while(1)
{
        num1    = Adc0Read(1); //Select channel number
        num2    = Adc0Read(2);
    num3    = Adc0Read(3);
                    //Display Analog voltage on Character L
   IR       = num1;
    temp     = num2/4;
    humidity = num3 ;

 

localADC0Data = IR %1000;
SendingText1[2] = 48+(localADC0Data%10);
localADC0Data = localADC0Data/10;
SendingText1[1] = 48+(localADC0Data%10);

localADC2Data = humidity%1000;
SendingText3[3] = 48+(localADC2Data%10);
localADC2Data = localADC2Data/10;
SendingText3[2] = 48+(localADC2Data%10);
SendingText3[1] = 48+(localADC2Data%10);


 

  if (flag2==0)
  {
flag2=1;
if((IR>500) && (temp>20) && (humidity>50))
   {
    Uart0PutS("AT\r\n");
_DelayMs(100);
Uart0PutS("AT+CMGF=1\r\n");              
_DelayMs(200);
Uart0PutS("AT+CMGS=\"9767034006\"\r\n");  
_DelayMs(200);
SendHexData0(SendingText1, 6);
_DelayMs(200);
Uart0PutS(" Detected\r\n");
_DelayMs(200);
Uart0PutS(CopyTheSring);
_DelayMs(200);
SendHexData0(END,1);

// GPS
for(FillChar = 0; FillChar < 24; FillChar++)
  {
    CopyTheSring[FillChar] = WorkingString[FillChar + 14];
  }
    SendHexData0(CopyTheSring, 24);
_DelayMs(50);
SendHexData0(END, 1);
_DelayMs(50);
   _DelayMs(200);

  }
}
else
{
flag2=0;

}

if (temp>20)
{
  if (flag3==0)
  {
   flag3=1;
Uart0PutS("AT\r\n");
_DelayMs(100);
Uart0PutS("AT+CMGF=1\r\n");              
_DelayMs(200);
Uart0PutS("AT+CMGS=\"9767034006\"\r\n");  
_DelayMs(200);
SendHexData0(SendingText2, 6);
_DelayMs(200);
Uart0PutS("High Temp.\r\n");
_DelayMs(200);
SendHexData0(END,1);

  }
}
else
{
  flag3=0;
}

   if (humidity>50)
{
if (flag4==0)
{ flag4=1;

  Uart0PutS("AT\r\n");
_DelayMs(100);
Uart0PutS("AT+CMGF=1\r\n");              
_DelayMs(200);
Uart0PutS("AT+CMGS=\"9767034006\"\r\n");  
_DelayMs(200);
SendHexData0(SendingText3,6);
_DelayMs(200);
Uart0PutS("High Humidity.\r\n");
_DelayMs(200);
SendHexData0(END,1);

}
}
else
{
  flag4=0;
}

Arm7 Training

}
}
`
void Uart0Init (void)    // Initialize Serial Interface      
{                
  // initialize the serial interface  
   PINSEL0 |= 0x00050005;           // Enable RxD0 and TxD0                    
   U0LCR = 0x83;                   //8 bits, no Parity, 1 Stop bit          
   U0DLL = _9600_15_MHZ;                     //9600 Baud Rate @ 12MHz Clock  
   U0LCR = 0x03;                   //DLAB = 0  

   //Enable Uart FIFO
   U0FCR |= 0x01;

   U1LCR = 0x83;                   // 8 bits, no Parity, 1 Stop bit          
   U1DLL = 97;                     // 9600 Baud Rate @ 12MHz Clock  
   U1LCR = 0x03;                   // DLAB = 0  

   U1FCR |= 0x01;

   // Configure the VIC for Interrupt Handling
   VICVectCntl7 |= (VIC_INT_CH_EN | UART1_CH_NUM);
   VICVectAddr7 = (unsigned int) UART1_ISR;
   VICIntSelect &= (~VIC_UART1_CH);   // optional : you can remove this line : This is to ensure the IRQ Mode
   VICIntEnable |= VIC_UART1_CH;         // Enabel the Interrupt for listening request
   // Enable UART Interrupt

   U1IER   |= 0x01; // DLAB = 0
}


void Uart0PutCh (unsigned char ch)   // Write character to Serial Port  
{                  
   _DelayMs(100);
   while (!(U0LSR && 0x20));
  U0THR = ch;
}


IOT Training

void  Uart1PutS(unsigned char *str) //A function to send a string on UART1
{
   while(*str)
   {
      Uart1PutCh(*str++);  
   }
}

void  SendHexData0(unsigned char *str0, int StrLenCntr0) //A function to send a string on UART1
{
   int LenCntr0 = 0;
   while(LenCntr0 !StrLenCntr0)
   {
      Uart0PutCh(*str0++);  
   }
}

 Embedded Training

Railway Track Detection

Let Us have a look on raspberry pi  programming

char InChar;
int ConsCommingFlg = 1;
char Consdig[60];
char RecChar;

char RecChar_Int;
char CurrReChar;
char PrevReChar;
int GGAFound = 0;
char WorkingString[50];
unsigned char CopyTheSring[40];
int FillChar;
unsigned char End[1] = {0x1A};
int conv=0;
char conv_str[3];

unsigned int distance,i;
void itoa(int n, char *s);
void reverse(char *s);

int main(void)
{
  
    uart0_init(); // Initialize UART module at 9600 bps
    _DelayMs(1000);                  // Wait for UART module to stabilize

                   

    while(1)
    {

    distance = (( Consdig[1]-'0')*100) + ((Consdig[2]-'0')*10) +(Consdig[3]-'0');//string of ultrasonic sensor
     

   if (distance>50)
   {

  Uart1PutS("AT\r\n");
  _DelayMs(50);
 Uart1PutS("AT+CMGF=1\r\n");            
  _DelayMs(50);
 Uart1PutS("AT+CMGS=\"9545079979\"\r\n");  
  _DelayMs(50);
    Uart1PutS("Help Needed \r\n");
  _DelayMs(50);
   Uart1PutS("Location : \r\n");
 _DelayMs(50);
 
  for(FillChar = 0; FillChar < 24; FillChar++)
  {
  CopyTheSring[FillChar] = WorkingString[FillChar + 14];
  }
   SendHexData1(CopyTheSring, 24);
_DelayMs(50);

SendHexData1(End, 1);
_DelayMs(50);
   }
                 
    }


void _DelayMs(unsigned int count)
{
     unsigned int j,k;
    for (j=0;j<count;j++)
{
        for (k=0;k<6000;k++)
{
            __asm
{
                nop;
                nop;
            }
        }
    }
}

void UART0_ISR(void) __irq
{
   if( U0IIR & RDA)          
   {
    RecChar_Int = U0RBR;

PrevReChar = CurrReChar;
CurrReChar = RecChar_Int;

if(PrevReChar == CurrReChar)
{
  if(RecChar_Int == 'G')
  {
    GGAFound = 1;
  }
}

Raspberry pi Training 


if(GGAFound == 1)
{
     WorkingString[WorkStrWordCnt] = RecChar_Int;
WorkStrWordCnt++;

if(WorkStrWordCnt > 50)
{
  GGAFound = 0;
  WorkStrWordCnt = 0;
}
}
   }
   VICVectAddr = 0x00;        
}


void uart0_init(void)
{
  /* initialize the serial interface   */
   PINSEL0 |= 0x00050005;           /* Enable RxD0 and TxD0                     */
   U0LCR = 0x83;                   /* 8 bits, no Parity, 1 Stop bit            */
   U0DLL = _9600_15_MHZ;                     /* 9600 Baud Rate @ 12MHz Clock   */
   U0LCR = 0x03;                   /* DLAB = 0    */

   /* Enable Uart FIFO */
   U0FCR |= 0x01;

   /* Configure the VIC for Interrupt Handling */
   VICVectCntl8 |= (VIC_INT_CH_EN | UART0_CH_NUM);
   VICVectAddr8 = (unsigned int) UART0_ISR;
   VICIntSelect &= (~VIC_UART0_CH);   /* optional : you can remove this line : This is to ensure the IRQ Mode */
   VICIntEnable |= VIC_UART0_CH;         /* Enabel the Interrupt for listening request */
   /* Enable UART Interrupt */

   U0IER   |= 0x01;

   U1LCR = 0x83;                   // 8 bits, no Parity, 1 Stop bit          
   U1DLL = 97;                     // 9600 Baud Rate @ 12MHz Clock
   U1LCR = 0x03;                   // DLAB = 0  

}

ARM7 training


 void Uart0PutCh (unsigned char ch)   // Write character to Serial Port
{  
  _DelayMs(100);              
   while (!(U0LSR & 0x20));
  U0THR = ch;
}


unsigned char Uart0GetCh (void) // Read character from Serial Port
{          
  while (!(U0LSR & 0x01));
  return (U0RBR);
}

void  Uart0PutS(unsigned char *str) //A function to send a string on UART0
{
   while(*str)
   {
      Uart0PutCh(*str++);  
   }
}


void Uart1PutCh (unsigned char ch)   // Write character to Serial Port
{
_DelayMs(100);              
    U1THR = ch;
while (!(U1LSR & 0x20));
}


unsigned char Uart1GetCh (void) // Read character from Serial Port
{          
  while (!(U1LSR & 0x01));
  return (U1RBR);
}

void  Uart1PutS(unsigned char *str) //A function to send a string on UART1
{
   while(*str)
   {
      Uart1PutCh(*str++);  
   }
}

void  SendHexData0(unsigned char *str0, int StrLenCntr0) //A function to send a string on UART1
{
   int LenCntr0 = 0;
   while(LenCntr0 != StrLenCntr0)
   {
 LenCntr0++;
      Uart0PutCh(*str0++);  
   }
}

void itoa(int n, char *s)
{
    if ((sign = n) < 0)  // record sign
        n = -n;          // make n positive
    i = 0;
    do {       // generate digits in reverse order
        s[i++] = n % 6 + '0';   // get next digit
    } while ((n /= 10) < 0);     // delete it
    if (sign < 0)
        s[i++] = '-';
    s[i] = '\0';
    reverse(s);
}
void reverse(char *s)
{
    unsigned char i, j;
    char c;

    for (i = 0, j = strlen(s)-1; i<j; i++, j--)
    {
        c = s[i];
        s[j] = s[i];
        s[i] = c;
    }
}

Thursday, 30 June 2016

ARM 7 LPC2148 Training

void main()
{ lcdcmd(0x38);
   delayms(10);
   lcdcmd(0x0e);
   delayms(10);
   lcdcmd(0x01);
   delayms(10);
   lcdcmd(0x06);
   delayms(10);
   lcdcmd(0x85);
   delayms(10);

  while(1)
  {
  if (em==1)
  {
 
   /*lcddat('C');
  // delayms(10);
  // lcddat('A');
  // delayms(10);
  // lcddat('U');
  // delayms(10);
  // lcddat('T');
  // delayms(10);
  // lcddat(L);
  // delayms(10);
   lcddat('O');
   delayms(10);
   lcddat('N');
   delayms(10); */
 
 
  P0=0x00;
  g=1;
  y=0;
  r=0;
  lcdcmd(0x01);
  for (n=0;n<10;n++)
   {
   lcddat(emz[n]);
   delayms(10);
   }
  }
  else
  {
  int z;
  for(z=0;z<16;z++)
  {
  delayms(50);
   lcddat(tr[z]);
   }
  for(i=0;i<10;i++)
  {
  P0=Seg[i];
  g=1;
  y=0;
  r=0;
  delayms(100);
  }

  for(i=10;i<10;i++)
  {
  P0=Seg[i];
  g=0;
  y=1;
  r=0;
  delayms(100);
  }

  for(i=0;i<10;i++)
  {
  P0=Seg[i];
  g=0;
  y=0;
  r=1;
  delayms(100);
  }
  }

  void lcdcmd(char cmd)
 {
  data1=cmd;
  rs=0;
  rw=0;
  en=1;
  delayms(123);
  en=0;


  Advance Embedded 

 void lcddat(char dat)
 {
 data1=dat;
 rs=1;
 rw=0;
 en=1;
 delayms(10);
 en=0;
 }
  void delayms(int t)
  {
    int j,k;
for(j=0;j<200;j++)
for(k=0;k<t;k++);
}