-
What does the Peripheral Bus do?
Connects all of the peripherals, but with a slower connection
-
What are the 4 types of memory in the PIC32?
- RAM - 128 kB
- Flash - 512 kB
- SFRs - 1 MB
- Boot Flash - 12 kB
-
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.
-
What number systems are used?
- Signed
- Unsigned
- Encoding:
- decimal
- binary
- hex
-
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
-
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
-
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
-
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
-
Set BIT_5
A | BIT_5 - sets bit 5 in A to 1
-
Clear BIT_5
(A & ~BIT_5) - clears bit 5 in A
-
Toggle BIT_5
- (A ^ BIT_5) - toggles bit 5 in A
- (XOR)
-
Shift X 3 bits to the right
(X >> 3)
-
Shift X 3 bits to the left
(3 << X)
-
How many bits do PORT_A....PORT_G have?
16 bits
-
ODC
Logic high (1) means tri-state
-
TRIS
Direction (input or output)
-
-
LAT
- Actual port value when written to.
- Returns what was last programmed to the port when read.
-
What does PLib stand for?
Peripheral Library
-
Set a specific pin as an input
SetPinsDigitalIn(Port, Bit Mask)
-
Set a specific pin as an output
SetPinsDigitalOut(Port, Bit Mask)
-
Write all bits in a port
PORTWrite(Port, value)
-
Write only the masked bit
- PORTSetBits(Port, Mask)
- PORTClearBits(Port, Mask)
- PORTToggleBits(Port, Mask)
-
Read bits from a port
PORTRead(Port)
-
What is the term used for dealing with the jitter when pressing a button?
Debouncing
-
Interrupt Vector
"Index" number for where to read the interrupt code from.
-
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.
-
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.
-
Interrupt Enable Bit
Enables the interrupt to be triggered.
-
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.)
-
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
-
What is a timer "Period"?
generate an interrupt when we hit the period
-
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
|
|