Introduction%20to%20C%20and%20Microcontrollers%20Study%20Guide

Introduction%20to%20C%20and%20Microcontrollers%20Study%20Guide

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Introduction
to
C
and
Microcontrollers
 Study
Guide
 
 Question
1.
Getting
to
know
your
microcontroller
 a. b. c. d. e. f. 
 Question
2.
Data
Types
 a. b. c. d. 
 Question
3.
Setting
up
a
timer

 a. List
five
different
events
that
can
trigger
an
interrupt.
 b. Set
up
the
register
values
for
using
timer0
in
compare
and
clear
on
match
 mode
with
a
compare
value
of
189.
Initialize
the
timer
register
to
150.
Do
not
 worry
about
a
clock
prescalar.
Describe
the
behavior
of
this
counter.

 TCNT0
 
 
 TCCR0
 
 
 OCR0
 
 
 TIMSK0
 
 
 OCIE2
 
 
 TOIE2
 
 
 
 
 TICIE1
 OCIE1A
 OCIE1B
 TOIE1
 
 OCIE0
 
 TOIE0
 
 Bit
[7]
 
 F0C0
 
 Bit
[7]
 
 Bit
[6]
 
 Bit
[5]
 
 Bit
[4]
 
 Bit
[3]
 
 Bit
[2]
 
 CS02
 
 Bit
[2]
 
 Bit
[1]
 
 CS01
 
 Bit
[1]
 
 Bit
[0]
 
 CS00
 
 Bit
[0]
 How
many
bits
are
used
to
represent
a
char,
int,
long,
and
double?
 What
is
the
maximum
value
a
char,
int,
and
long
can
assume?

 What
is
the
difference
between
a
signed
and
unsigned
int?
 Why
would
a
variable
be
declared
volatile?
 How
many
input/output
pins
does
the
microcontroller
have?
 What
is
the
purpose
of
an
interrupt?
 What
is
the
fundamental
difference
between
timer0
and
timer1?
 What
prescalars
are
available
for
timer0?

 What
are
the
pin
numbers
of
i/o
port
D0..D7?
 What
is
the
difference
between
PORTx
and
PINx?
 
 
 
 
 WGM00
 COM01
 COM00
 WGM01
 
 Bit
[6]
 
 Bit
[5]
 
 Bit
[4]
 
 Bit
[3]
 Question
4.
Digital
Logic
and
Boolean
Operators
 
 
 
 
 A
=
0b01001011
 B
=
0b00101101
 C
=
0b11001011
 D
=
0b00000000
 Determine
output
of
binary
expressions
 a. b. c. d. e. f. 
 Question
5.
Writing
a
loop
 Set
up
the
i/o
ports
D
as
an
output
and
initialize
to
0x01.
Write
a
main
function
that
 includes
the
port
initialization
and
a
loop
that
changes
the
output
on
PORTD
as
 follows:
 
 
 
 Initial:
0x01
 
 
 0x02
 0x04
 0x08
 0x10
 0x20
 0x40
 Final:
 0x80
 Make
sure
to
read
about
the
available
operators
in
the
C
language.
 
 BONUS:

 Find
the
error
in
the
programming
guide
related
to
setting
up
the
1kHz
timer
 starting
on
page
16.
 A&B
 A&&C
 (A&&B)|C
 C&&(!D)
 C&(~D)
 (~A|C)
&
B
 ...
View Full Document

This note was uploaded on 10/02/2010 for the course MAE 3780 taught by Professor Wickenhieser during the Fall '08 term at Cornell University (Engineering School).

Ask a homework question - tutors are online