All About Circuits

Digital Circuits

Microcontroller Principles


20 questions By Tony R. Kuphaldt

Page 1 of 7 0 of 20 answers revealed (0%)
  • Question 1 of 20

    Read the following quotation, and then research the term microcontroller to see what relevance it has to the quote:

    I went to my first computer conference at the New York Hilton about 20 years ago. When somebody there predicted the market for microprocessors would eventually be in the millions, someone else said, “Where are they all going to go? It’s not like you need a computer in every doorknob!” Years later, I went back to the same hotel. I noticed the room keys had been replaced by electronic cards you slide into slots in the doors. There was a computer in every doorknob. - Danny Hillis
    Reveal answer
  • Question 2 of 20

    A microcontroller unit, or MCU, is a specialized type of digital computer used to provide automatic sequencing or control of a system. Microcontrollers differ from ordinary digital computers in being very small (typically a single integrated circuit chip), with several dedicated pins for input and/or output of digital signals, and limited memory. Instructions programmed into the microcontroller’s memory tell it how to react to input conditions, and what types of signals to send to the outputs.

    The simplest type of signal “understood” by a microcontroller is a discrete voltage level: either “high” (approximately V) or “low” (approximately ground potential) measured at a specified pin on the chip. Transistors internal to the microcontroller produce these “high” and “low” signals at the output pins, their actions being modeled by SPDT switches for simplicity’s sake:



    Microcontrollers may be programmed to emulate the functions of digital logic gates (AND, OR, NAND, NOR, etc.) in addition to a wide variety of combinational and multivibrator functions. The only real limits to what a microcontroller can do are memory (how large of a program may be stored) and input/output pins on the MCU chip.

    However, microcontrollers are themselves made up of many thousands (or millions!) of logic gate circuits. Why would it make sense to use a microcontroller to perform a logic function that a small fraction of its constituent gates could accomplish directly? In other words, why would anyone bother to program a microcontroller to perform a digital function when they could build the logic network they needed out of fewer gate circuits?

    Reveal answer
  • Question 3 of 20

    A student decides to build a light-flasher circuit using a microcontroller instead of a 555 timer or some other hard-wired astable circuit. Unfortunately, there is a problem somewhere. When first powered up, the LED lights on for 1 second, then turns off and never turns back on. The only way the LED ever comes back on is if the MCU is reset or its power is cycled off and on:



    Pseudocode listing Declare Pin0 as an output

    BEGIN

    Set Pin0 HIGH

    Pause for 1 second

    Set Pin0 LOW

    END

    A fellow student, when asked for help, modifies the program listing and re-sends it from the personal computer where it is being edited to the microcontroller, through a programming cable. The program listing now reads as such:

    Pseudocode listing Declare Pin0 as an output

    LOOP

    Set Pin0 HIGH

    Pause for 1 second

    Set Pin0 LOW

    ENDLOOP

    When the MCU is reset with the new program, the LED starts blinking on and off . . . sort of. The LED is “on” most of the time, but once every second it turns off and then immediately comes back on. In fact, the “off” period is so brief it is barely noticeable.

    What the student wanted was a 50% duty cycle: “on” for 1 second, then “off” for 1 second, repeating that cycle indefinitely. First, explain the significance of the classmate’s program modification, and then modify the program listing again so that the LED does what the student wants it to.

    Reveal answer