LCP4801 COMPREHENSIVE EXAM PREP
QUESTIONS AND SOLUTIONS VERIFIED
STUDY RESOURCE
●● List the two OS APIS below that could be used to set the baud rate
and data bits for the PC's USB virtual serial port.
Answer: GetCommStatus() and SetCommStatus()
●● What processor hardware feature forces the use of "sudo" to run
PIGPIO and most other programs using an addon I/O library program to
interface to I/O pins on the Pi?
Answer: Access to Memory-Mapped I/O:
The I/O pins on the Raspberry Pi are controlled by registers that are
memory-mapped; they are accessed as if they were ordinary memory
locations.
Direct access to these memory regions is restricted by the Linux kernel
to prevent accidental or malicious interference with the hardware that
could destabilize the system.
Privileged Operation:
Modifying the memory-mapped I/O requires root privileges because it's
a critical operation that affects the hardware directly.
Running a program with "sudo" elevates the privileges of that process to
the root user level, allowing it to perform operations that are otherwise
restricted.
,Protection from Unauthorized Access:
The requirement for "sudo" acts as a security measure to ensure that
only authorized users can perform potentially dangerous operations that
could affect the system's stability or security.
Therefore, when you run PIGPIO or similar libraries that interact
directly with the GPIO pins on the Raspberry Pi, you typically need to
use "sudo" to grant the necessary permissions to access the hardware
resources.
●● How to use C# to display text on uLCD:
Answer: SerialPort mySerialPort = new SerialPort("COM3"); // Replace
"COM3" with your actual port and config settings
mySerialPort.Open();
mySerialPort.WriteLine("Hello, uLCD!"); // The command to write text
will depend on your uLCD's instruction set
mySerialPort.Close();
●● Which requires more explicit I/O API calls in a user's C++ source
code for communication with an I/O device like an LED or sensor, the Pi
with Linux or the mbed? Explain exactly why?
Answer: Raspi since Linux is a full fledged OS
●● List 2 common language Features that are problematic in Safety
Critical Coding
,Answer: Dynamic Memory Allocation, and Recursion. This pretty much
narrows usable languages down to C
●● ___________ is the name for the lowest level software routine in an
OS that talks directly to a specific type of I/O device
Answer: Device Driver
●● The P4 processor contains dynamically scheduled pipelines with up
to __________ stages.
Answer: 20+or 30+(new P4)
●● The ___________ chip on a PC motherboard connects to the PCI bus
and provides the legacy ISA bus signals.
Answer: Southbridge
●● In general, what is needed to build a USB peripheral interface?
Answer: SIE serial interface engine with differential line drivers &
receivers
Microcontroller with RAM/ROM and USB firmware to encode and
decode USB packets
●● What is the significance of a WinMain procedure in a Windows
application. What does it have to do and contain?
, Answer: It is the main entry point for a Windows application. It typically
sets up, creates, and displays the main window. It must also contain a
Windows messaging loop that translates and dispatches messages to the
Window.
●● What is a message dispatch table and why is it sometimes used in
Win32 programs?
Answer: A message dispatch table is an array of pointers to each
procedure used in the Windows call back procedure for each message. It
is used instead of a long case statement for faster execution time.
●● What are the difference and tradeoffs in a hard vs. soft IP core in
FPGAs?
Answer: Soft IP cores use the FPGA's internal logic they are more
flexible but have lower performance than a custom VLSI layout.
Hard IP cores have a custom VLSI layout and have higher speed, lower
power, and less chip area but offer less flexibility.
●● What is a USB SIE and why is it needed? Explain
Answer: SIE is the Serial Interface Engine. Hardware must be used to
support the high clock rates needed for parallel to serial and serial
conversion between the USB bus and the USB microcontroller.
QUESTIONS AND SOLUTIONS VERIFIED
STUDY RESOURCE
●● List the two OS APIS below that could be used to set the baud rate
and data bits for the PC's USB virtual serial port.
Answer: GetCommStatus() and SetCommStatus()
●● What processor hardware feature forces the use of "sudo" to run
PIGPIO and most other programs using an addon I/O library program to
interface to I/O pins on the Pi?
Answer: Access to Memory-Mapped I/O:
The I/O pins on the Raspberry Pi are controlled by registers that are
memory-mapped; they are accessed as if they were ordinary memory
locations.
Direct access to these memory regions is restricted by the Linux kernel
to prevent accidental or malicious interference with the hardware that
could destabilize the system.
Privileged Operation:
Modifying the memory-mapped I/O requires root privileges because it's
a critical operation that affects the hardware directly.
Running a program with "sudo" elevates the privileges of that process to
the root user level, allowing it to perform operations that are otherwise
restricted.
,Protection from Unauthorized Access:
The requirement for "sudo" acts as a security measure to ensure that
only authorized users can perform potentially dangerous operations that
could affect the system's stability or security.
Therefore, when you run PIGPIO or similar libraries that interact
directly with the GPIO pins on the Raspberry Pi, you typically need to
use "sudo" to grant the necessary permissions to access the hardware
resources.
●● How to use C# to display text on uLCD:
Answer: SerialPort mySerialPort = new SerialPort("COM3"); // Replace
"COM3" with your actual port and config settings
mySerialPort.Open();
mySerialPort.WriteLine("Hello, uLCD!"); // The command to write text
will depend on your uLCD's instruction set
mySerialPort.Close();
●● Which requires more explicit I/O API calls in a user's C++ source
code for communication with an I/O device like an LED or sensor, the Pi
with Linux or the mbed? Explain exactly why?
Answer: Raspi since Linux is a full fledged OS
●● List 2 common language Features that are problematic in Safety
Critical Coding
,Answer: Dynamic Memory Allocation, and Recursion. This pretty much
narrows usable languages down to C
●● ___________ is the name for the lowest level software routine in an
OS that talks directly to a specific type of I/O device
Answer: Device Driver
●● The P4 processor contains dynamically scheduled pipelines with up
to __________ stages.
Answer: 20+or 30+(new P4)
●● The ___________ chip on a PC motherboard connects to the PCI bus
and provides the legacy ISA bus signals.
Answer: Southbridge
●● In general, what is needed to build a USB peripheral interface?
Answer: SIE serial interface engine with differential line drivers &
receivers
Microcontroller with RAM/ROM and USB firmware to encode and
decode USB packets
●● What is the significance of a WinMain procedure in a Windows
application. What does it have to do and contain?
, Answer: It is the main entry point for a Windows application. It typically
sets up, creates, and displays the main window. It must also contain a
Windows messaging loop that translates and dispatches messages to the
Window.
●● What is a message dispatch table and why is it sometimes used in
Win32 programs?
Answer: A message dispatch table is an array of pointers to each
procedure used in the Windows call back procedure for each message. It
is used instead of a long case statement for faster execution time.
●● What are the difference and tradeoffs in a hard vs. soft IP core in
FPGAs?
Answer: Soft IP cores use the FPGA's internal logic they are more
flexible but have lower performance than a custom VLSI layout.
Hard IP cores have a custom VLSI layout and have higher speed, lower
power, and less chip area but offer less flexibility.
●● What is a USB SIE and why is it needed? Explain
Answer: SIE is the Serial Interface Engine. Hardware must be used to
support the high clock rates needed for parallel to serial and serial
conversion between the USB bus and the USB microcontroller.