Review for Second Exam
- C Programming
- Setting and clearing bits in registers
PORTA = PORTA | 0x02;
PORTA = PORTA & ~0x0C;
- Using pointers to access specific memory location or port.
* (unsigned char *) 0x0400 = 0xaa;
#define PORTX (* (unsigned char *) 0x400)
PORTX = 0xaa;
- Interrupt Vectors (and reset vector)
- How to set interrupt vector in C
- How do you enable interrupts (specific mask and general mask)
- What happens to stack when you receive an enabled interrupt
- What happens when you leave ISR with RTI instruction?
- What setup do you need to do before enabling interrupts?
- What do you need to do in interrupt service routine (clear source of
interrupt, exit with RTI instruction)?
- How long (approximately) does it take to service an interrupt?
- Timer/Counter Subsystem
- Enable Timer
- Timer Prescaler
- How to set
- How it affects frequency of timer clock
- Timer Overflow Interrupt
- Input Capture
- Output Compare
- How to enable interrupts in the timer subsystem
- How to clear flags in the timer subsystem
- Real Time Interrupt
- How to enable
- How to change rate
- How to enable interrupt
- How to clear flag
- Pulse Width Modulation
- How to get into 8-bit, left-aligned high-polarity mode
- How to set PWM period (frequency)
- How to set PWM duty cycle
- How to enable PWM channel