Chapter 3: Further Microcontrollers Flashcards

1
Q

What is the structure of the main program code

A

Label Command Operand ; comments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give three examples of input devices

A

Microswitch
Temperature sensor
Microphone

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give three examples of output components

A

LED
Motor
Speakes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the architecture of a microcontroller

A

Input port connected to the CPU from the left
Output port connected to the CPU from the right
Memory connected to the CPU from above
Clock connected to the CPU from the bottom

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name the two types of microcontroller memory

A

Program memory and Data memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What do vectors do?

A

Tell the processor what to do in specific events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the reset vector address?

A

0000h
It contains a goto command followed by a label at the start of the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the interrupt vector address?

A

0004h
It contains a goto command and a label at the start of the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a subroutine?

A

They carry out operations that can be used many times.
They are short sections of program in an area of memory outside the main program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How would you jump to a subroutine?

A

Using the call command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How would you jump back to the main program from a subroutine

A

Using the return command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How would you configure PortA

A

Using the TrisA command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How would you configure portB

A

Using the TrisB command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How would you configure a bit to be an input in portA?

A

Put a logic 1 in TrisA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How would you configure a bit to be an output in portA?

A

Put a logic 0 in TrisA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe the interrupt service routine step by step

A
  1. Interrupt is detected
  2. Completes the instruction it is currently executing
  3. Stores the contents of the program center on the stack
  4. Loads the interrupt vector address 0004h
  5. Executes the instruction found here
17
Q

What is the stack?

A

An area of program memory used to store return addresses

18
Q

What are the three bits we use from the INTCON register

A

Bit 1,4 and 7

19
Q

What is bit 7 from the INTCON register

A

The global interrupt bit (GIE)

20
Q

What does a logic 1 at bit7 GIE cause?

A

Enables all interrupt sources

21
Q

What does a logic 0 at bit 7 GIE cause?

A

Disables all the interrupt sources

22
Q

What is bit 4 on the INTCON register?

A

External interrupt enable bit (INT0IE)

23
Q

What does a logic 1 at bit 4 INT0IE cause?

A

Enables the interrupt

24
Q

What does a logic 0 at bit 4 INT0IE cause?

A

Disables the interrupt

24
Q

What is bit 1 on the INTCON register?

A

The external interrupt flag (INT0IF)

25
Q

What does a logic 1 at bit 1 INT01F cause?

A

Interrupt occurred

26
Q

What does a logic 0 at bit 1 INT01F cause?

A

No interrupt occured

27
Q

What must be set to respond to an interrupt?

A

Bit 7 GIE

28
Q

ISR must clear an interrupt otherwise what will happen?

A

The interrupt will run completly

29
Q

Is the GIE cleared automatically if yes, then how?

A

With a retfie command.
Note: Return command will not do this