Provide an example of using the 'const' qualifier.
const float PI = 3.14;
What is the oscillator frequency assumed in the code?
12 MHz.
1/130
p.7
Modifiers and Qualifiers in Embedded C

Provide an example of using the 'const' qualifier.

const float PI = 3.14;

p.19
Delay Generation in Embedded C

What is the oscillator frequency assumed in the code?

12 MHz.

p.11
Interrupt Service Routine (ISR

How is an ISR defined in Embedded C?

It is defined using the syntax: 'interrupt void isr(void) { /* normal C code here */ };'

p.19
Delay Generation in Embedded C

What is the purpose of the provided code?

To generate delays of 500 microseconds and 1 second using Timer 1 and Timer 0 respectively.

p.16
8051 Microcontroller Programming

Which pin is used to sense if the lift door is open?

Pin 1 of Port 1 (P1.1).

p.22
Introduction to Embedded C

Which department is Dr. Arun Chavan associated with?

Department of Electronics and Computer Science.

p.1
8051 Microcontroller Programming

What is the focus of the course taught by Dr. Arun Chavan?

Microcontrollers & Applications.

p.17
8051 Microcontroller Programming

What is the primary function of the program for LED blinking using the 8051 microcontroller?

To turn an LED on and off at regular intervals.

p.1
Introduction to Embedded C

Which department is Dr. Arun Chavan associated with?

Department of Electronics and Computer Science.

p.10
Macros vs Functions in Embedded C

When are macros particularly useful?

When small code is repeated many times.

p.5
Modifiers and Qualifiers in Embedded C

On which data type can the 'short' modifier be used?

Only on the int data type.

p.20
Serial Communication in Embedded C

What is the purpose of the program provided?

To transmit the character 'S' to the serial port at a baud rate of 9600.

p.9
Macros vs Functions in Embedded C

What is the effect of using functions on code length?

Using functions keeps the code length unaffected.

p.5
Modifiers and Qualifiers in Embedded C

What are modifiers in Embedded C?

Keywords that modify the default properties of int and char data types.

p.10
Macros vs Functions in Embedded C

What is the speed of execution for macros compared to functions?

Macros are faster, while functions are slower.

p.10
Macros vs Functions in Embedded C

What occurs during a function call?

Transfer of control takes place.

p.2
8051 Microcontroller Programming

Which department offers the 8051 programming course?

Department of Electronics and Computer Science.

p.8
Modifiers and Qualifiers in Embedded C

What will happen if the 'signal' variable is changed from outside the program?

The while loop will terminate when 'signal' is no longer 0.

p.12
8051 Microcontroller Programming

What is the purpose of the provided Embedded C program?

To toggle Pins of Port 2.

p.6
Modifiers and Qualifiers in Embedded C

What range of values can 'long long' store?

From -9223372036854775808 to 9223372036854775807.

p.18
8051 Microcontroller Programming

Which header file is included in the program?

<reg51.h>

p.16
8051 Microcontroller Programming

What happens when the door is sensed as open (door==1)?

The alarm is activated (alarm = 1) for a duration defined by the software delay.

p.19
Delay Generation in Embedded C

Which timer is used to generate a delay of 1 second?

Timer 0 (T0M1) in mode 1.

p.21
Embedded C Programming Examples

Write an Embedded C program for LED blinking at regular intervals of 2 secs with an oscillator frequency of 12 MHz.

The program would involve setting up a timer to create a 2-second delay and toggling the LED connected to Port 1.

p.8
Modifiers and Qualifiers in Embedded C

Provide an example of declaring a volatile variable in Embedded C.

volatile int signal = 0;

p.17
8051 Microcontroller Programming

Which microcontroller is used for the LED blinking program?

8051 microcontroller.

p.19
Delay Generation in Embedded C

Which timer is used to generate a delay of 500 microseconds?

Timer 1 (T1M1) in mode 1.

p.18
8051 Microcontroller Programming

What is the purpose of the program provided?

To blink an LED using the 8051 microcontroller.

p.4
Data Types in Embedded C

What is the range of a signed char in Embedded C?

-128 to +127.

p.15
8051 Microcontroller Programming

How is the packed BCD value calculated in the program?

By combining the lower nibbles of data1 and data2.

p.12
8051 Microcontroller Programming

Which header file is included in the program?

<reg51.h>

p.20
Serial Communication in Embedded C

What does the command 'SCON=0x40;' do in the code?

It programs the serial port.

p.6
Modifiers and Qualifiers in Embedded C

What is the default modifier for int and char data types in Embedded C?

'signed'.

p.18
8051 Microcontroller Programming

What is the significance of the 'for' loop with 'i<40000'?

It creates a normal delay between LED state changes.

p.4
Data Types in Embedded C

What is the bit size and range of a bit in Embedded C?

1 bit, with values of 0 or 1 (bit addressable RAM).

p.20
Delay Generation in Embedded C

What values are loaded into TL1 and TH1 for 9600 baud rate?

0xfd.

p.21
Modifiers and Qualifiers in Embedded C

What are Modifiers in Embedded C?

Modifiers in Embedded C are keywords that change the properties of data types, such as signed, unsigned, short, and long.

p.9
Macros vs Functions in Embedded C

What is the main difference in processing between macros and functions in Embedded C?

Macros are pre-processed, while functions are compiled.

p.7
Modifiers and Qualifiers in Embedded C

What does the 'const' qualifier do?

It imposes a restriction on the variable so that its value can't be changed or modified.

p.13
8051 Microcontroller Programming

What is the purpose of the provided Embedded C program?

To toggle pin 1 of Port 1 continuously without affecting other pins.

p.5
Modifiers and Qualifiers in Embedded C

How many bytes does the 'short' modifier use?

2 Bytes.

p.15
8051 Microcontroller Programming

What is the purpose of the provided Embedded C program?

To convert ASCII digits 6 and 8 to packed BCD and send it on Port 0.

p.6
Modifiers and Qualifiers in Embedded C

What is the size of 'long long' in Embedded C?

8 bytes.

p.15
8051 Microcontroller Programming

Which header file is included in the program?

<reg51.h>

p.16
8051 Microcontroller Programming

Which pin is connected to the alarm in the program?

Pin 7 of Port 1 (P1.7).

p.5
Modifiers and Qualifiers in Embedded C

Provide an example of using the 'short' modifier in Embedded C.

short int myShortIntegerValue = 18;

p.10
Macros vs Functions in Embedded C

Do macros check for compile-time errors?

No, macros do not check for compile-time errors.

p.16
8051 Microcontroller Programming

What does the variable 'x' represent in the program?

It is used for creating a software delay.

p.10
Macros vs Functions in Embedded C

Do functions check for compile-time errors?

Yes, functions check for compile-time errors.

p.4
Data Types in Embedded C

What is the bit size and range of an unsigned int in Embedded C?

16 bits (2 bytes), ranging from 0 to 65535.

p.15
8051 Microcontroller Programming

What does the line 'P0 = (data2 & 0x0f) + ((data1 & 0x0f) << 4);' do?

It assigns the packed BCD value to Port 0.

p.18
8051 Microcontroller Programming

What is the purpose of the 'while(1)' loop in the program?

To create a continuous loop for blinking the LED.

p.12
8051 Microcontroller Programming

What does the line 'P2=0x00;' do in the program?

It sets all pins of Port 2 to low.

p.16
8051 Microcontroller Programming

What is the purpose of the 'while (1)' loop in the program?

To continuously check the state of the door.

p.14
8051 Microcontroller Programming

What happens if Port 1 pin 0 is not high?

Port 2 is set to 00H.

p.2
8051 Microcontroller Programming

Who is associated with the 8051 programming course?

Dr. Arun Chavan.

p.9
Macros vs Functions in Embedded C

How does using macros affect code length?

Using macros increases the code length.

p.11
Interrupt Service Routine (ISR

What is an ISR in Embedded C?

An ISR (Interrupt Service Routine) is a software process invoked by an interrupt request from a hardware device.

p.10
Macros vs Functions in Embedded C

What happens to a macro name before compilation?

It is replaced by the macro code.

p.16
8051 Microcontroller Programming

What is the purpose of the embedded C program provided?

To switch on the alarm connected to P1.7 when the lift door is open.

p.7
Modifiers and Qualifiers in Embedded C

What is the main use of the 'const' qualifier?

To define constants in your program.

p.13
8051 Microcontroller Programming

How is pin 1 of Port 1 referenced in the program?

It is named as 'mybit' using 'sbit mybit = P1^1;'.

p.4
Data Types in Embedded C

How many bits does a float data type occupy in Embedded C?

32 bits (4 bytes).

p.15
8051 Microcontroller Programming

What are the ASCII values of the digits being converted in the program?

0x36 for '6' and 0x38 for '8'.

p.3
Introduction to Embedded C

What are some extensions of Embedded C compared to standard C?

I/O Hardware Addressing and accessing address spaces.

p.13
8051 Microcontroller Programming

What does 'mybit = 1;' accomplish in the program?

It sets pin 1 of Port 1.

p.19
Delay Generation in Embedded C

What is the purpose of the 'while (TF1==0);' statement in the delay function?

It waits until Timer 1 overflow flag (TF1) is set, indicating the delay is complete.

p.4
Data Types in Embedded C

What is the size and address range of 'sfr' in Embedded C?

8 bits (1 byte), with addresses from 80h to FFh.

p.12
8051 Microcontroller Programming

What type of loop is used to continuously toggle the pins?

An infinite while loop.

p.20
8051 Microcontroller Programming

What does 'TR1=0;' do at the end of the transmission?

It turns Timer 1 OFF.

p.21
Embedded C Programming Examples

Write an Embedded C program to toggle P1.1 at regular intervals of 5 msec.

The program would use a timer to create a delay of 5 msec and toggle the state of P1.1.

p.22
Introduction to Embedded C

Who is thanked in the message?

Dr. Arun Chavan.

p.9
Macros vs Functions in Embedded C

What type checking is done with macros compared to functions?

No type checking is done in macros, while type checking is done in functions.

p.7
Modifiers and Qualifiers in Embedded C

What are the two types of qualifiers available in Embedded C?

'const' and 'volatile'.

p.11
Interrupt Service Routine (ISR

What does an ISR do when invoked?

It handles the interrupt request and sends it to the CPU, interrupting the active process.

p.11
Interrupt Service Routine (ISR

What happens after the ISR is complete?

The interrupted process is resumed.

p.4
Data Types in Embedded C

What is the bit size and range of a signed int in Embedded C?

16 bits (2 bytes), ranging from -32768 to +32767.

p.13
8051 Microcontroller Programming

Which header file is included in the program?

#include<reg51.h>

p.4
Data Types in Embedded C

What is the range of an unsigned char in Embedded C?

0 to 255.

p.3
Introduction to Embedded C

What is Embedded C?

An extension of the C Programming Language used in the development of Embedded Systems.

p.17
8051 Microcontroller Programming

What is the typical output pin used to connect the LED in the 8051 microcontroller?

Port 1 or Port 0.

p.7
Modifiers and Qualifiers in Embedded C

Why is the value of PI defined as 'const'?

So that it can't be changed accidentally.

p.14
8051 Microcontroller Programming

What is the purpose of the provided Embedded C program?

To monitor Port 1 pin 0 and set Port 1 or Port 2 to 00H based on its state.

p.3
Introduction to Embedded C

Why is the C Programming Language popular in various applications?

It provides low-level memory access and efficient mapping to machine instructions.

p.13
8051 Microcontroller Programming

What type of loop is used to continuously toggle the pin?

An infinite while loop (while(1)).

p.20
8051 Microcontroller Programming

What is the function of 'TMOD=0x20;' in the code?

It programs Timer 1 in mode 2.

p.19
Delay Generation in Embedded C

What is the loop condition for generating a 1-second delay?

The loop runs 20 times, incrementing 'count' each time.

p.18
8051 Microcontroller Programming

What does the statement 'P1=0xAA;' do in the program?

It sends the hex value 0xAA to port 1.

p.12
8051 Microcontroller Programming

What value is assigned to Port 2 after the first delay?

0xff (sets all pins of Port 2 to high).

p.21
Embedded C Programming Examples

Write an Embedded C program to switch on the alarm connected to P1.7 when the lift door is open, sensed by P1.1.

The program would involve reading the state of P1.1 and setting P1.7 high if the door is open.

p.2
8051 Microcontroller Programming

What is the primary focus of 8051 programming?

To control and manage embedded systems using the 8051 microcontroller.

p.8
Modifiers and Qualifiers in Embedded C

What does the 'volatile' qualifier indicate in Embedded C?

It indicates that a variable's value can be changed from outside the program.

p.8
Modifiers and Qualifiers in Embedded C

What is the purpose of the while loop in the provided example?

It continuously checks if the 'signal' variable is equal to 0.

p.5
Modifiers and Qualifiers in Embedded C

How many modifiers are there in C?

There are 4 modifiers.

p.5
Modifiers and Qualifiers in Embedded C

What does the 'short' modifier do?

It limits the user to store small integer values from -32768 to +32767.

p.17
8051 Microcontroller Programming

What programming language is used for the LED blinking program?

Embedded C.

p.6
Modifiers and Qualifiers in Embedded C

What is the size of 'long' in Embedded C?

4 bytes.

p.17
8051 Microcontroller Programming

What is a common delay mechanism used in LED blinking programs?

Using a loop to create a time delay.

p.10
Macros vs Functions in Embedded C

When are functions particularly useful?

When large code is to be written.

p.13
8051 Microcontroller Programming

What does the line 'mybit = 0;' do in the program?

It clears pin 1 of Port 1.

p.20
8051 Microcontroller Programming

Which microcontroller is being programmed in the provided code?

The 8051 microcontroller.

p.19
Delay Generation in Embedded C

What values are loaded into TH1 and TL1 for a 500 microsecond delay?

TH1=0xFE and TL1=0x0C.

p.6
Modifiers and Qualifiers in Embedded C

What does the 'signed' modifier indicate in Embedded C?

It allows storage of both negative and positive values.

p.4
Data Types in Embedded C

What does 'sbit' represent in Embedded C?

1 bit, with values of 0 or 1 (bit addressable sfr).

p.3
Introduction to Embedded C

In what types of systems is Embedded C commonly used?

In Embedded Systems and Super Computers.

p.6
Modifiers and Qualifiers in Embedded C

How do you declare a signed integer in Embedded C?

'signed int myNegativeIntegerValue = -544;'.

p.19
Delay Generation in Embedded C

What values are loaded into TH0 and TL0 for a 1-second delay?

TH0=0x3C and TL0=0xB0.

p.21
Data Types in Embedded C

What are the Embedded C data types?

The basic data types in Embedded C include int, char, float, and double.

p.20
Interrupt Service Routine (ISR)

What is the purpose of the 'while(TI==0);' loop?

To check for the 'Transmit Interrupt' before proceeding.

p.21
Serial Communication in Embedded C

Write an Embedded C program to transmit character ‘A’ through the serial port at a baud rate of 2400 with an oscillator frequency of 12 MHz.

The program would configure the serial port settings and send the character 'A' at the specified baud rate.

p.3
Introduction to Embedded C

What features of the C Programming Language does Embedded C retain?

It uses the same syntax and semantics, including main function, data type declarations, loops, functions, and statements.

p.13
8051 Microcontroller Programming

What is the purpose of the for loops in the program?

To create a software delay.

p.20
8051 Microcontroller Programming

What is the oscillator frequency assumed in the program?

12 MHz.

p.14
8051 Microcontroller Programming

Which pin of Port 1 is monitored in the program?

Pin 0 of Port 1.

p.16
8051 Microcontroller Programming

What is the initial state of the alarm in the program?

The alarm is turned off (alarm = 0).

p.15
8051 Microcontroller Programming

What is the significance of the while(1) loop in the program?

It creates an infinite loop to keep the program running.

p.6
Modifiers and Qualifiers in Embedded C

What does the 'unsigned' modifier do in Embedded C?

It allows storage of only positive values.

p.6
Modifiers and Qualifiers in Embedded C

How do you declare an unsigned integer in Embedded C?

'unsigned int myIntegerValue = 486;'.

p.21
Modifiers and Qualifiers in Embedded C

What are Qualifiers in Embedded C?

Qualifiers in Embedded C are used to define the storage duration and visibility of variables, such as const and volatile.

p.6
Modifiers and Qualifiers in Embedded C

What is the syntax to declare a long long integer in Embedded C?

'long long int myLongIntegerValue = 827337203685421584;'.

p.18
8051 Microcontroller Programming

What does the statement 'P1=0x55;' do in the program?

It sends the hex value 0x55 to port 1.

p.14
8051 Microcontroller Programming

What happens if Port 1 pin 0 is high?

Port 1 is set to 00H.

p.12
8051 Microcontroller Programming

What is the purpose of the for loops in the program?

To create a software delay.

p.20
8051 Microcontroller Programming

What does 'TR1=1;' do in the program?

It turns Timer 1 ON.

p.20
Interrupt Service Routine (ISR)

What happens when 'TI' is reset in the code?

It indicates that the transmission is complete.

p.21
Interrupt Service Routine (ISR)

What is ISR in Embedded C?

ISR stands for Interrupt Service Routine, which is a function that handles interrupts in Embedded C.

p.14
8051 Microcontroller Programming

What is the significance of 'sbit mybit = P1^0;' in the program?

It defines mybit as Pin 0 of Port 1 for easy reference.

p.14
8051 Microcontroller Programming

What does the 'while (1)' loop indicate in the program?

It creates an infinite loop to continuously monitor the pin state.

p.14
8051 Microcontroller Programming

What header file is included in the program?

<reg51.h>

p.21
Macros vs Functions in Embedded C

Differentiate between ‘Macros’ & ‘Functions’ in Embedded C.

Macros are preprocessor directives that are replaced by their definitions before compilation, while functions are blocks of code that can be called and executed at runtime.

Study Smarter, Not Harder
Study Smarter, Not Harder