ECE2534 Midterm Exam 1

Card Set Information

ECE2534 Midterm Exam 1
2012-10-16 00:02:57
ECE 2534

ECE2534 Midterm review
Show Answers:

  1. What does the Peripheral Bus do?
    Connects all of the peripherals, but with a slower connection
  2. What are the 4 types of memory in the PIC32?
    • RAM - 128 kB
    • Flash - 512 kB
    • SFRs - 1 MB
    • Boot Flash - 12 kB
  3. Why is C programming used with microcontrollers?
    C is a lower level language that works directly with the hardware. Has the right data types as well.
  4. What number systems are used?
    • Signed
    • Unsigned
    • Encoding:
    •    decimal
    •    binary
    •    hex
  5. How are number systems represented?
    Number systems are represented the same way in the memory, but we as programmers decide how to represent it. Example: 0101 means something different in decimal and binary
  6. What are the different Data Types?
    • [unsigned] char - 8 bits
    • [unsigned] short - 16 bits
    • [unsigned] int - 32 bits
    • [unsigned] long - 32 bits
    • [unsigned] long long - 64 bits
  7. precidence
    • some expressions are more important than others:
    • a*b+c; //(a*b) will always be evaluated first
    • c+a*b; //(a*b) will always be evaluated first
  8. associativity
    • can evaluate right to left or left to right:
    • a+b+c; //evaluates a+b and then +c, left -> right
    • a++; //reads right -> left
  9. Set BIT_5
    A | BIT_5 - sets bit 5 in A to 1
  10. Clear BIT_5
    (A & ~BIT_5) - clears bit 5 in A
  11. Toggle BIT_5
    • (A ^ BIT_5) - toggles bit 5 in A
    • (XOR)
  12. Shift X 3 bits to the right
    (X >> 3)
  13. Shift X 3 bits to the left
    (3 << X)
  14. How many bits do PORT_A....PORT_G have?
    16 bits
  15. ODC
    Logic high (1) means tri-state
  16. TRIS
    Direction (input or output)
  17. PORT
    Actual port value
  18. LAT
    • Actual port value when written to.
    • Returns what was last programmed to the port when read.
  19. What does PLib stand for?
    Peripheral Library
  20. Set a specific pin as an input
    SetPinsDigitalIn(Port, Bit Mask)
  21. Set a specific pin as an output
    SetPinsDigitalOut(Port, Bit Mask)
  22. Write all bits in a port
    PORTWrite(Port, value)
  23. Write only the masked bit
    • PORTSetBits(Port, Mask)
    • PORTClearBits(Port, Mask)
    • PORTToggleBits(Port, Mask)
  24. Read bits from a port
  25. What is the term used for dealing with the jitter when pressing a button?
  26. Interrupt Vector
    "Index" number for where to read the interrupt code from.
  27. Interrupt Priority
    Priority level of the interrupt. If two interrupts are triggered at the same time, the one with the higher Interrupt Priority will execute.
  28. Interrupt Subpriority
    Priority level of an interrupt. Only used when two interrupts are triggered at the same time that have the same Interrupt Priority. The one with the higher Interrupt Subpriority will execute.
  29. Interrupt Enable Bit
    Enables the interrupt to be triggered.
  30. Interrupt Flag
    Turned on to trigger an interrupt. When the interrupt has finished running, must be reset (if not, the interrupt will not be triggered again.)
  31. What does it mean for a counter to be "Prescaled"?
    When counting longer times, the counter must be prescaled, meaning that for every "n" number of counts, up the counter by one
  32. What is a timer "Period"?
    generate an interrupt when we hit the period
  33. What is the difference between "Input Capture" and "Output Compare"?
    • Input capture triggers the interrupt when a port's bit goes from low->high or high->low.
    • Output Compare checks to see if the timer is equal to the OC, and if so, triggers a change