In: Computer Science
Please answer these questions clearly in hand written, thank you!
1. Explain 4 things you can do with a JTAG unit while debugging code.
2. The first time an optical shaft encoder was connected to a microprocessor the engineer used an external interrupt but with it configured as a level edge triggered interrupt. Explain why that was not a good idea
3. Discuss the differences between “bare metal” and a Linux operating system and give an example of when each is more appropriate.
May this helps you...
Answer 1:
Answer 2:
Encoder signals should be detected and interpreted within the software as fast as possible to not block the most process flow. we will detect the signals by polling within the main loop or using interrupts. Polling isn't an efficient way because you'll got to reserve time and resources in your main loop which can bring extra delays. Using interrupts may be a faster and cost-effective solution. we'll show you ways to use interrupts to handle the encoder signals.
There are two sorts of interrupts which will be used for this purpose; External Interrupt and Pin Change Interrupt. External Interrupt can detect whether the input is falling or rising and may be triggered in one among the chosen states which are: rising, falling, or toggling. There are more hardware resources for Pin Change Interrupt but it cannot detect the falling or the rising edge and it's triggered when any logical change occurs.
Answer 3:
Bare metal refers to run a program or software directly on the
hardware level without the support of any OS .
In other words, program a microcontroller directly with a bunch of
lines of C or Assembler-code, because it was traditionally made in
electronics and that we learned it.
It is a low-level method of programming and it's specific to the
hardware used.
Most of the bare-metal projects don't start from scratch (at all). it might cost tons to start out every project from zero again and again. We use instead some already tested libraries.
In embedded Linux, applications run over or supported by the kernel, acting as an OS . The "kernel" is that the nucleus or core of the OS controlling almost everything within the system.
Normal user-defined applications are called “User Space Applications” and that they have intermediate layers until they access the hardware. For that purpose, they have to travel through the kernel space to access to the HW. In Userspace is simply a piece of memory and over the kernel.
The bigger difference (and advantage) is that the userspace
applications are hardware-independent.
The kernel of Linux consists of varied modules, which interact
directly with the underlying hardware.
It provides the specified abstraction to cover low-level hardware details to system or application programs and thus made it hardware-independent.