Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

LPC1768 Embedded Protocols UART, SPI and I2C

Total questions: 56

Worksheet time: 28mins

Name
Class
Date
1.

In LPC1768, the LCR (Line Control Register) is used to configure which of the following UART settings?

a)

Baud rate

b)

Data length, stop bits, and parity

c)

Transmit and receive buffers

d)

Interrupt priority

2.

What does the RBR Register in LPC1768 store?

a)

The UART baud rate

b)

Data received from the UART

c)

Data to be transmitted over UART

d)

UART interrupt flags

3.

In LPC1768 UART , the FDR Register is used for:

a)

Calculating the UART baud rate more precisely

b)

Configuring the number of stop bits

c)

Managing UART interrupts

d)

Enabling the UART peripheral

4.

Which bit in the LSR indicates that the UART transmit holding register (THR) is empty in LPC1768?

a)

Bit 0

b)

Bit 1

c)

Bit 5

d)

Bit 7

5.

What is the correct formula for calculating the baud rate in LPC1768's UART?

a)

Baud Rate = PCLK / (DLL * 16)

b)

Baud Rate = PCLK / (16 * (DLL + DLM))

c)

Baud Rate = PCLK / (16 * (DLL + (DLM << 8)))

d)

Baud Rate = PCLK / (DLL * FDR)

6.

In LPC1768, which UART register is responsible for indicating that a framing error has occurred?

a)

LSR

b)

LCR

c)

IER

d)

RBR

7.

If DLL = 0x01 and DLM = 0x00, what is the baud rate for UART in LPC1768 when PCLK = 1 MHz?

a)

1 Mbps

b)

9600 bps

c)

115.2 kbps

d)

62.5 kbps

8.

In LPC1768 UART, the FCR Register is used to:

a)

Control the FIFO buffer size

b)

Enable or disable the FIFO buffers

c)

Configure the baud rate

d)

Set parity and stop bits

9.

What is the correct sequence to initialize UART0 in LPC1768 C programming?

a)

Configure PCONP, PINSEL0, LCR, DLM/DLL

b)

Configure PCONP, PINSEL1, FCR, THR

c)

Configure PINSEL0, PCONP, LCR, RBR

d)

Configure DLM/DLL, THR, PCONP, RBR

10.

In LPC1768 UART C programming, what does the following line configure for UART2?

UART2->LCR = (3 << 0) | (1 << 7);

a)

8-bit data length and divisor latch access

b)

7-bit data length and enable interrupts

c)

8-bit data length and enable parity

d)

8-bit data length and disable interrupts

11.

In LPC1768 C programming, how do you check if data is available to read from UART2?

a)

if (UART2->LSR & (1 << 5))

b)

if (UART2->LSR & (1 << 0))

c)

if (UART2->RBR)

d)

if (UART2->LSR & (1 << 7))

12.

Which register in LPC1768 is used to configure SPI in master mode?

a)

SPCCR

b)

SPCR

c)

SPDR

d)

SPSR

13.

In LPC1768 SPI communication, what does the SPIF bit in the SPSR register indicate?

a)

SPI is idle

b)

SPI data transfer is complete

c)

A fault occurred during transmission

d)

SPI is configured as a slave

14.

If PCLK = 1 MHz and SPCCR = 8, what is the resulting SPI clock frequency?

a)

125 kHz

b)

250 kHz

c)

500 kHz

d)

1 MHz

15.

Which register in LPC1768 stores the data received from the slave during SPI communication?

a)

SPRR

b)

SPCR

c)

SPDR

d)

SPSR

16.

What is the maximum clock rate for SPI communication if the PCLK = 1 MHz on LPC1768?

a)

1 MHz

b)

500 kHz

c)

250 kHz

d)

125KHz

17.

Which mode in SPI communication ensures that data is sampled on the rising edge and shifted out on the falling edge?

a)

Mode 0

b)

Mode 1

c)

Mode 2

d)

Mode 3

18.

How is SPI Mode 3 (CPOL = 1, CPHA = 1) configured in LPC1768 using the SPCR register?

a)

SPCR |= (1 << 2) | (1 << 3);

b)

SPCR &= ~(1 << 4);

c)

SPCR |= (1 << 3) | (1 << 4);

d)

SPCR |= (1 << 6);

19.

In LPC1768, how is the SPI module configured as a master in C programming?

a)

SPCR |= (1 << 3);

b)

SPCR |= (1 << 2);

c)

SPCR &= ~(1 << 3);

d)

SPCR |= (1 << 5);

20.

What is the main advantage of using interrupt-driven SPI communication in LPC1768 over polling-based communication?

a)

It increases the clock speed.

b)

It reduces CPU idle time and improves efficiency.

c)

It simplifies the code.

d)

It avoids hardware limitations.

21.

How is a specific slave device selected in an SPI communication setup?

a)

By setting the appropriate SCK line

b)

By asserting the corresponding SS (Slave Select) line low

c)

By changing the clock polarity

d)

By sending a unique address to the slave

22.

. In a single-master, multi-slave SPI configuration, what should the SSEL (Slave Select) pin status be on the master device?

a)

Pulled high during communication

b)

Asserted low only when communicating with the specific slave

c)

Toggled for each data byte transfer

d)

Pulled low continuously

23.

. In a scenario where multiple SPI slaves are connected to a master, how do you prevent multiple slaves from responding at the same time?

a)

By enabling only one SS pin at a time

b)

By sending a start signal to only one slave

c)

By sending different clock signals to each slave

d)

By using a different MOSI pin for each slave

24.

What is the behavior of the MISO line when the slave device is not selected (SS is high)?

a)

It remains in a high-impedance state (Hi-Z)

b)

It outputs zeroes

c)

It echoes the master's clock signal

d)

It continuously transmits data

25.

. In SPI communication, what is the role of the clock polarity (CPOL) and clock phase (CPHA) settings?

a)

They define how data is transmitted between multiple masters

b)

They control the speed of the SPI clock

c)

They configure the idle state of the clock and the data sampling points

d)

They determine which slave will respond

26.

What is the typical configuration for the SS (Slave Select) pin when using SPI in single-master, multi-slave mode?

a)

Each slave has its dedicated SS pin connected to the master

b)

All slaves share a single SS pin

c)

SS is unused in multi-slave mode

d)

The SS pin is toggled by the master for every byte transfer

27.

What is the main function of the MAX7219/MAX7221 IC?

a)

To control the brightness of LEDs

b)

To drive 7-segment displays and LED matrices

c)

To handle serial communication

d)

To generate clock signals for SPI

28.

When interfacing the MAX7219/MAX7221 with LPC1768, which SPI mode is required for proper synchronization /correct data transfer between the master and slave ?

a)

SPI Mode 0 (CPOL = 0, CPHA = 0)

b)

SPI Mode 1 (CPOL = 0, CPHA = 1)

c)

SPI Mode 2 (CPOL = 1, CPHA = 0)

d)

SPI Mode 3 (CPOL = 1, CPHA = 1)

29.

What is the purpose of the DECODE MODE register in the MAX7219/MAX7221?

a)

To set the brightness of the display

b)

To define whether the data sent corresponds to a 7-segment or a raw LED pattern

c)

To set the number of digits to display

d)

To configure SPI clock speed

30.

How many 7-segment display units can one MAX7219/MAX7221 drive simultaneously?

a)

1

b)

2

c)

4

d)

8

31.

To display a number on the first digit of a 7-segment display connected to the MAX7219/MAX7221, which register should be addressed?

a)

DIGIT0

b)

DIGIT1

c)

DIGIT2

d)

SCAN LIMIT

32.

What is the SCAN LIMIT register used for in the MAX7219/MAX7221?

a)

To define the number of 7-segment digits to display

b)

To set the SPI clock frequency

c)

To reset the display

d)

To enable brightness control

33.

What happens if the DECODE MODE is set to 0xFF in MAX7219/MAX7221?

a)

All digits will decode data as 7-segment data

b)

All digits will display a test pattern

c)

All digits will be turned off

d)

All digits will decode raw LED data

34.

What is the maximum current that can be driven by the MAX7219/MAX7221 per segment?

a)

10 mA

b)

20 mA

c)

40 mA

d)

60 mA

35.

Which SPI clock frequency would be required for proper communication between the LPC1768 and MAX7219?

a)

Higher than 10 MHz

b)

Exactly 1 MHz

c)

Less than 10 MHz

d)

100 kHz

36.

What does the I2C protocol use to communicate between master and slave devices?

a)

2-wire synchronous multi-master, multi-slave full-duplex serial communication

b)

2-wire synchronous multi-master, mult-slave half-duplex serial communication

c)

2-wire synchronous single-master, multi-slave full-duplex serial communication

d)

2-wire synchronous single-master, multi-slave half-duplex serial communication

37.

What does the I2C protocol use to communicate between master and slave devices?

a)

SCLK, MISO,MOSI,SS lines

b)

TXD,RXD lines

c)

SCL,SDA lines

d)

Parallel lines

38.

In the LPC1768 I2C module, which register is used to set the clock speed?

a)

I2CONSET

b)

I2SCLH & I2SCLL

c)

I2DAT

d)

I2CONCLR

39.

Which type of data transfer is not supported by the I2C protocol?

a)

Master to slave

b)

Slave to master

c)

Full-duplex transfer

d)

Multi-master mode

40.

What is the purpose of the clock stretching mechanism in I2C?

a)

To generate a higher clock speed

b)

To allow the slave to hold the clock line low until it is ready

c)

To reset the I2C bus

d)

To stop data transfer temporarily

41.

What is the typical maximum data rate supported by the standard mode of I2C?

a)

100 kHz

b)

400 kHz

c)

1 MHz

d)

3.4 MHz

42.

In I2C communication, how is arbitration handled when two masters initiate communication simultaneously?

a)

The master with the higher address wins

b)

The master with the lower address wins

c)

The clock speed is increased

d)

The bus is reset automatically

43.

What does the I2C acknowledge (ACK) signal indicate?

a)

Start of communication

b)

Successful data reception

c)

Error in data transmission

d)

End of communication

44.

In the LPC1768 I2C peripheral, what is the purpose of the I2CONSET register?

a)

To read the received data

b)

To control I2C operations like start, stop, and acknowledgment

c)

To set the clock frequency

d)

To configure interrupt settings

45.

. In the LPC1768 I2C C programming, which bit must be set in I2CONCLR to clear the interrupt flag?

a)

SI

b)

STA

c)

STO

d)

AA

46.

When configuring the I2C clock in LPC1768, which registers are modified to set the high and low times of the SCL signal?

a)

I2SCLH and I2SCLL

b)

I2CONSET and I2CONCLR

c)

I2DAT and I2ADR

d)

I2MASK and I2STAT

47.

When using the LPC1768 I2C peripheral in master mode, what is the purpose of setting the STA bit in the I2CONSET register?

a)

To stop the I2C communication

b)

To start the I2C communication

c)

To acknowledge the data transfer

d)

To enable clock stretching

48.

In LPC1768 I2C, clearing which bit in the I2CONCLR register will disable the Acknowledge (ACK) signal?

a)
  • SI

b)
  • STA

c)
  • AA

d)
  • STO

49.

In LPC1768, What is the minimum and maximum i2c clock speed achievable if PCLK=1MHz

a)

15.25Hz & 1MHz

b)

3.92KHz & 512KHz

c)

1 Hz & 256KHz

d)

7.6 Hz & 128KHz

50.

What is the format of a 7-bit I2C slave address field of I2C frame?

a)

In two byte with the first byte as the address and the second byte as R/W

b)

In two byte with the first byte as R/W and the second byte as address

c)

In one byte with the first 7 bits as the address and the last bit as R/W

d)

In one byte with the first bit as R/W and remaining 7 bits as the address

51.

How is a 10-bit I2C address formatted and transmitted over the bus?

a)

The first byte contains first 8 bits of the address while the second byte contains the remaining 3 bits of the address followed by the R/W bit

b)

The first byte contains first 7 bits of the address and the R/W bit while the second byte contains the remaining 3 bits of the address

c)

The first byte contains the fixed 1111 followed by the first 3 bits of the address and the R/W bit, while the second byte contains the remaining 8 bits of the address.

d)

The first byte contains the the first 3 bits of the address , while the second byte contains the remaining 7 bits of the address and the R/W bit.

52.

What is the 7-bit I2C address format for the 24C04 EEPROM when it is interfaced with an LPC1768 as an I2C master?

a)
  • 0x50 to 0x53 (based on A0 and A1 pins configuration)

b)
  • 0xA0 to 0xA7

c)
  • 0x00 to 0x03

d)
  • 0x40 to 0x47

53.

In a random byte read operation from a 24C04 EEPROM, what sequence of operations must be followed?

a)
  • Start → Send Slave Address (with R/W bit set to 0) → Send Memory Address → Restart → Send Slave Address (with R/W bit set to 1) → Read Data → Stop

b)
  • Start → Send Slave Address (with R/W bit set to 1) → Read Data → Stop

c)
  • Start → Send Memory Address → Read Data → Stop

d)
  • Start → Send Slave Address (with R/W bit set to 1) → Write Data → Stop

54.

In continuous read mode from the 24C04 EEPROM, what happens when the end of memory is reached?

a)
  • The device halts the I2C bus until a stop condition is detected

b)
  • The device wraps around to the beginning of memory

c)
  • The device continues reading but returns the last valid byte

d)
  • The device generates a NACK and stops communication

55.

In a write operation to the 24C04 EEPROM, what is the required delay for the memory to complete the internal write cycle before it can accept another operation?

a)
  • 1 ms

b)
  • 5 ms

c)
  • 10 ms

d)
  • 50 µs

56.

What should be done after writing a byte to the 24C04 EEPROM to ensure that the next write starts at a new memory location?

a)
  • Send a restart condition

b)
  • Send a stop condition and then a new start condition

c)
  • Send an acknowledge signal

d)
  • Send a NACK signal