Wednesday, 30 December 2020

Chevening Interview Prep Questions (few examples)


Below are the set of questions that you may want to consider during the interview prep session:

1. Why do you want to study in the UK?

2. Why did you choose this course/program?

3. What do you intend to do after the Chevening MSc program?

4. State some examples exhibiting your leadership skills.

5. How will this scholarship help you in the development of your home country?

6. What will you do if you don't get the scholarship?

7. What are your greatest achievements?

8. What are your strengths and weaknesses?

9. Why did you select these three universities?

10. Why is a particular uni your first preference?

11. Which leader (could be from your field) do you admire and why?

12. Why are you interested in Chevening Scholarship particularly (the main advantage is the network, think of other reasons as well)?

13. What are the other activities which you are interested in doing in the UK besides focussing on academics?

14. What changes would you like to bring about in your field in your home country?

15. Are there any challenges that you face during your time in the UK (eg. staying away from the family) and would you able to successfully complete the MSc. program?

16. State any examples showcasing your networking skills or do you have the networking skills and how will you use it to leverage the condition in your home country (in your field)?

17. Do you need an MSc. degree to bring about changes in your field of interest (in your home country)? Justify why an MSc. program a prerequisite for you.

18. Is your work experience in line with the field that you want to pursue your MSc. in?

19. Have you already got admission in any of the universities (it will be best if you have already got the admission)

20. Would you like to change the preferences of uni? (rearranging the order)

21. Do you have any questions?

Also, prepare the most commonly asked questions:

1. Tell us something about yourself (keep this answer brief and to the point)

2. Where do you see yourself in 5 to 10 years time?

3. Your strengths and weaknesses.




Sunday, 18 October 2020

CCS code - Graph utility (temperature monitoring)

Do check the youtube video on Graph Tool of CCS : 


Do SUBSCRIBE to my channel!

I have used this code for temperature monitoring: 


#include <msp430g2553.h>


int temp = 0;

int temp1 =0;

void main(void){

WDTCTL = WDTPW | WDTHOLD; //stop the watchdog timer



//Select 1.5 V, 64 clock cycles, enable ADC interrupt, Turn on the reference generator

ADC10CTL0 = SREF_1 + REFON + ADC10ON + ADC10SHT_3 + ADC10IE;


//Select input channel 10 and divide the clock frequency by 4

ADC10CTL1 = INCH_10 + ADC10DIV_3;


while(1){

//Enable and Start conversion

ADC10CTL0 |= ENC + ADC10SC;


//Enter low power mode

__bis_SR_register(LPM0_bits + GIE);


//fetch the temperature value from ADC10MEM register

temp1 = ADC10MEM;


//convert it into degree celsius

temp = ((temp1 * 27069L - 18169625L)>>16);


}

}


//ISR

#pragma vector = ADC10_VECTOR

__interrupt void adc_interrupt(void)


{

__bic_SR_register_on_exit(CPUOFF);

}


Sunday, 27 September 2020

MSP430 with a DC motor

The explanation for this project can be found here: Video explanation

Subscribe to the channel for more such content.

Below is the code:


#include <msp430g2553.h>

int count = 0;
void main()
{
WDTCTL = WDTPW | WDTHOLD;   // Stop watchdog timer

P1DIR |= BIT6|BIT2;
P1SEL |= BIT6; //P1.6 TA0.1 output signal for DC motor
P1OUT &= ~(BIT2);  //P1.2 for DC motor 

P1DIR &= ~BIT3; //Button P1.3
P1REN |= BIT3;
P1OUT |= BIT3;
P1IE |= BIT3;
P1IES |= BIT3;
CCR0 = 1000-1;
CCTL1 = OUTMOD_7;

__enable_interrupt();
__low_power_mode_0();



}
#pragma vector=PORT1_VECTOR
__interrupt void P1_Func()
{
int i = 0;
count = count + 1;
switch (count)
{
case 1: CCR1 = 850-1;
TACTL = TASSEL_2 + MC_1;
break;
case 2: CCR1 = 250-1;
count = 0;
break;
}

while(i<500)
{
if((P1IN&BIT3))
i++;
else
i=0;
}
P1IFG &= ~BIT3;
}

Friday, 28 August 2020

MSP430 with RGB LED - Pulse Width Modulation (PWM)

This post is related to the Pulse width modulation using MSP430 launchpad and RGB LED. 

All the details for the implementation of this project are provided on My YouTube channel : https://www.youtube.com/watch?v=o-tf9ZC-rSQ

Do Subscribe to the channel to see more content related to embedded systems.


Below is the CCS code:

#include <msp430.h>

#define MAX_TIME (1000)
#define MAX_COUNT (50)
int rv = 750; //red
int gv = 0;   //green
int bv = 0;   //blue
int fac = 50;  //change by a factor of 50

int c = 0;
int d = 0;

inline void update_colors(void)
{
if(d<15) 
{
rv = rv - fac;
bv = bv + fac;
gv = 0;
d++;

TA1CCR2 = rv;
TA1CCR1 = bv;
TA0CCR1 = gv;
}

if(d>14 && d<30) 
{
rv = 0;
bv = bv - fac;
gv = gv + fac;

d++;

TA1CCR2 = rv;
TA1CCR1 = bv;
TA0CCR1 = gv;

}

if(d>29 && d<45) 
{
bv = 0;
rv = rv + fac;
gv = gv - fac;

d++;

TA1CCR2 = rv;
TA1CCR1 = bv;
TA0CCR1 = gv;
}

if(d==45) 

d=0;

}


int main()
{
WDTCTL = WDTPW + WDTHOLD;

P2DIR |= (BIT1 | BIT5);
P2SEL |= (BIT1 | BIT5);

TA1CCR0 = MAX_TIME;
TA1CCTL1 = OUTMOD_7;
TA1CCTL2 = OUTMOD_7;
TA1CCR1 = rv;
TA1CCR2 = bv;
//Start the timer 1
TA1CTL = TASSEL_2 | MC_1;


P1DIR |= BIT6;
P1SEL |= BIT6;
TA0CCR0 = MAX_TIME;
TA0CCTL1 = OUTMOD_7;
TA0CTL |= TAIE;
TA0CCR1 = gv;

//Start timer 0
TA0CTL |= TASSEL_2 | MC_1;

//Turn off CPU and interrupt enabled
_BIS_SR((LPM0_bits | GIE));

while(1) {}
return 0;
}

__attribute__((interrupt(TIMER0_A1_VECTOR)))
void tim0_a1_isr(void)
{
++c;
if(c >= MAX_COUNT)
{
update_colors();
c=0;
}
TA0CTL &= ~TAIFG;
}

Thursday, 16 July 2020

Pulse Width Modulation using MSP430 Timer (Launchpad)

Video based Tutorial for PWM generation using MSP430 is covered on my YouTube channel:

Please Subscribe to the Channel!

Code used for generation of PWM:

#include <msp430g2553.h>

void main(void)
{
 WDTCTL = WDTPW + WDTHOLD;  // Stop WDT
 P1DIR |= BIT6;             // P1.6 set for output
 P1SEL |= BIT6;             // select TA0.1 output signal
 CCR0 = 1000-1;             // PWM Time Period/ frequency (1 KHz)
 CCTL1 = OUTMOD_7;          // reset/set mode 7 for output signal
 CCR1 = 750-1;                // PWM Duty cycle is 75%
 TACTL = TASSEL_2 + MC_1;   // SMCLK and Up Mode
 _BIS_SR(LPM0_bits);        // Enter LPM0
}


You can change the value in CCR1 and get different Ton/ Duty cycles. This will cause the LED to appear brighter or dimmer (higher the value or closer it is to CCR0 value, the LED will appear brighter).
Time period or frequency of the PWM signal can be changed by selecting different clock frequency or by dividing the clock frequency and by changing the CCR0 value.

Monday, 6 July 2020

MSP430 Timer in Compare Mode - Part 1 (Up Mode)


Video based Tutorial for Timer in Compare mode is available on My YouTube Channel: https://youtu.be/Drisf7VQI60

Please Subscribe to the Channel!

Code:


#include <msp430g2553.h>

void main(void)
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
  P1DIR |= 0x40;                            // P1.6 output
  CCTL0 = CCIE;                             // CCR0 interrupt enabled
  CCR0 = 65000;
  TACTL = TASSEL_2 + MC_1;                  // SMCLK, upmode

  _BIS_SR(LPM0_bits + GIE);                 // Enter LPM0 w/ interrupt
}

// Timer A0 interrupt service routine  - CCR0 vector
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A (void)
{
  P1OUT ^= 0x40;                            // Toggle P1.6
}


Monday, 1 June 2020

MSP430 UART - internal temperature sensor value on PC

Video explanation of the project is available on my 
YouTube channelhttps://youtu.be/2g9ohxlH3s0

Do Subscribe to it for more projects related to embedded systems.

Software Code used on Code Composer Studio:

#include <msp430.h>


unsigned int i; //Counter
void int_char();
int j=0;
char str[4];
int temp = 0;


int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT

/*Port 2 disabled*/
P2DIR = 0xFF; //All P2.x output
P2OUT &= 0x00; //reset


/* Use Calibration values for 1MHz Clock DCO*/
DCOCTL = 0;
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;

/* Configure Pin Muxing P1.1 RXD and P1.2 TXD */
P1SEL = BIT1 | BIT2 ;
P1SEL2 = BIT1 | BIT2;

/* Place UCA0 in Reset to be configured */
UCA0CTL1 = UCSWRST;

/* Baud Rate configuration */
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 104; // 1MHz 9600
UCA0BR1 = 0; // 1MHz 9600
UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1

/* Take UCA0 out of reset */
UCA0CTL1 &= ~UCSWRST;

/*Configure ADC10*/
ADC10CTL0 = SREF_1 + REFON + ADC10ON + ADC10SHT_3 + ADC10IE;

ADC10CTL1 = INCH_10 + ADC10DIV_3;
while(1)
{

j=0;
IE2 |= UCA0RXIE; //Enable USCI_A0 RX interrupt


__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled

temp = ADC10MEM; //ADC10 conversion value stored in temp
temp = ((temp * 27069L - 18169625L)>>16); //value converted to degree celsius
j=temp;
int_char(); //convert int to char string
UC0IE |= UCA0TXIE; //transmit the value
//i=0; //reset the counter
}
}

/* RX ISR : Start conversion on demand, i.e. whenever t is received*/
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
if (UCA0RXBUF == 't')
{
ADC10CTL0 |= ENC + ADC10SC; //Start Conversion
}
}

/* TX ISR : Transmit the temperature value*/
#pragma vector=USCIAB0TX_VECTOR
__interrupt void USCI0TX_ISR(void)
{

UCA0TXBUF = str[i++]; // TX next character
if (i==sizeof str -1) //Tx over?
{
UC0IE &= ~UCA0TXIE; //Disable Tx interrupt
i=0;
}
}
/*ADC10 ISR: switch ON the CPU*/
#pragma vector = ADC10_VECTOR
__interrupt void adc_interrupt(void)
{
__bic_SR_register_on_exit(CPUOFF); // Return to active mode

}

/*Convert the int value to char string*/
void int_char()
{
int s=0;
s=j%10;
str[2]=(char)(s+48);
j=j/10;
s=j%10;
str[1]=(char)(s+48);
j=j/10;
s=j%10;
str[0]=(char)(s+48);
str[3]='\0';
}

Wednesday, 11 March 2020

MSP430G2553 internal temperature sensor with LCD - Software code and Circuit diagram

Below is the Circuit Diagram and the Software Code for displaying the internal temperature sensor data on LCD.

Circuit Diagram:

Note: Connect a 47K ohm resistor between the RST pin and VCC (3.3V)
Vcc for MSP = 3.3V and Vcc for LCD = 5V
LCD used is JHD162A

Circuit Diagram


Software Code:

The lcd.h can be accessed here: https://binabhatt.blogspot.com/2018/05/pulse-rate-detector-using-msp430.html

#include <msp430.h>
#include "lcd"
/*
 * main.c
 */
void int_char();
int j=0;
char str[4];
int temp = 0;
int main(void) {

WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

P1OUT=0x00;      //Configure Port1 for LCD

P1DIR |= (BIT0 + BIT6); // P1.0 output

InitializeLcm();

ClearLcmScreen();
PrintStr("Temp is");
ADC10CTL0 = SREF_1 + REFON + ADC10ON + ADC10SHT_3 + ADC10IE;

ADC10CTL1 = INCH_10 + ADC10DIV_3;

ADC10CTL0 |= ENC + ADC10SC; //Start Conversion

__bis_SR_register(LPM0_bits + GIE);

temp = ADC10MEM;
temp = ((temp * 27069L - 18169625L)>>16); //temperature in degree celsius
j=temp;
int_char();
LcmSetCursorPosition(2,0);
PrintStr(str);

return 0;
}

//Interrupt vector  ADC10
#pragma vector = ADC10_VECTOR
__interrupt void adc_interrupt(void)
{
__bic_SR_register_on_exit(CPUOFF); // Return to active mode

}

//Convert int to char for LCD
void int_char()
{
int s;
s=j%10;
str[2]=(char)(s+48);
j=j/10;
s=j%10;
str[1]=(char)(s+48);
j=j/10;
s=j%10;
str[0]=(char)(s+48);
str[3]='\0';
}

Video Explanation:

Wednesday, 19 February 2020

Pulse Rate detector using MSP430 - Circuit Diagram

Hello All,

I have uploaded the snapshot of the circuit diagram for Pulse Rate detector using MSP430g2553. Hope it helps! If it did then do your bit by subscribing to my YouTube channel where I post videos related to Embedded systems!

Circuit diagram

Pin connections between the micro-controller and the LCD (JHD162A) are as follows:

Micro-controller
LCD
3
4
4
6
6
11
7
12
14
13
15
14

Wednesday, 5 February 2020

MSP430G2553 internal temperature sensor

MSP430 Launchpad - Internal Temperature Sensor

Code:


#include <msp430g2553.h>

int temp = 0;
int main(void){
WDTCTL = WDTPW | WDTHOLD; //stop the watchdog timer


//Select 1.5 V, 64 clock cycles, enable ADC interrupt, Turn on the reference generator
ADC10CTL0 = SREF_1 + REFON + ADC10ON + ADC10SHT_3 + ADC10IE;

//Select input channel 10 and divide the clock frequency by 4
ADC10CTL1 = INCH_10 + ADC10DIV_3;

//Enable and Start conversion
ADC10CTL0 |= ENC + ADC10SC;

//Enter low power mode
__bis_SR_register(LPM0_bits + GIE);

//fetch the temperature value from ADC10MEM register
temp = ADC10MEM;

//convert it into degree celsius
temp = ((temp * 27069L - 18169625L)>>16);

return 0;
}

//ISR
#pragma vector = ADC10_VECTOR
__interrupt void adc_interrupt(void)

{
__bic_SR_register_on_exit(CPUOFF);
}

Explanation: https://youtu.be/51pAz11NklA