Exam Revision - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Exam Revision

Description:

This course was designed to provide. an understanding of the basic principles ... 0.1s or 1/20 s. These can be achieved by simply halving or quartering MCOUNT. ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 15
Provided by: visual1
Category:

less

Transcript and Presenter's Notes

Title: Exam Revision


1
Exam Revision  
EE1A2 
  • S. I. Woolley
  • Electronic, Electrical and Computer Engineering

2
Contents
  • Learning outcomes.
  • Revision suggestions.
  • Exam suggestions.
  • Writing code in the exam.
  • Common mistakes
  • Revision questions (and notes)

3
Summary of Learning Outcomes
  • This course was designed to provide
  • an understanding of the basic principles of
    microprocessors and appreciate the difference
    between microprocessors, microcontrollers and
    DSPs (digital signal processors),
  • a working knowledge of the PIC16F84
    microcontroller,
  • experience of assembler programming and a basic
    appreciation of embedded systems.  

4
Revision Suggestions
  • Read/work through course materials and examples.
  • Look at past exam questions so that you are
    familiar with the style of questions.
  • See on-line revision materials and the University
    exam paper database http//www.exampapers.bham.ac.
    uk.
  • For this subject a keyword search may not work
    because of varied abbreviations for the long
    title. When using this database always be very
    careful that you are reading the right
    examination paper.
  • Note in previous years a different number of
    questions were required.
  • Time your attempts at questions.
  • Work out your exam technique in advance. e.g.,
    allocate a set amount of time to read through all
    questions carefully.

5
Exam Suggestions
  • Take a calculator.
  • Read questions carefully.
  • Keep a close eye on the time.
  • Keep descriptive answers short and to the point.
  • Take note of how many marks are assigned to each
    question and dont spend long on questions with
    few marks.
  • Use diagrams, tables or bullet-point lists if
    useful.

6
Writing Code in the Exam
  • We have referenced different code structures
    during the course. These include code segments,
    templates, subroutines and programs.
  • Segments are lines of code.
  • Templates are code frameworks (define the
    structure of components but dont contain any
    actual instructions)
  • Subroutines are the component program tasks
    completed by a return instruction.
  • Programs are full program listings including
    header with device and function fields.
  • You will not be asked to write a full program
    listing in the exam.
  •  

7
Writing Code in the Exam
  • Use the instruction set and/or register file map
    and information provided.
  • READ THE QUESTION VERY CAREFULLY
  • (dont write components that are NOT required)
  • You could use a simple flow diagram to get you
    started.
  • Comment your code (keep comments clear and
    concise)
  • Do you need supporting equates or org statements?
    If the question asks for them they will be worth
    marks.
  •  

8
Common Mistakes
  • that lose marks
  • Misreading the question.
  • Not using the register file list or instruction
    list.
  • Fundamental errors (e.g., errors of the type
    advantage of TMR0 delay over software delay is
    that it is faster)
  • Most common major loss of marks occurs when no
    attempt at all is made of a component.
  • that dont lose marks
  • Slightly different time delay times (our
    approximation is only an approximation - slightly
    different counter values are fine)
  • Misspelling generally loses no marks unless, for
    example, a valid instruction is misspelt as a
    different instruction
  • E.g., no lost marks for misspelling interrupt.

9
Course Revision Questions for you to try
  • What is the PIC16F84?
  • (A descriptive summary of the most important
    points)
  • Write a simple template for a PIC assembler
    program that shows the reader the order of the
    basic contents of PIC assembler file. (For the
    program header comments, list only the important
    fields. )
  • (Think of the content of a typical program what
    does it contain and in what order?)
  • Write a simple program segment (with supporting
    equates and comments) to configure PORTA pins as
    inputs and PORTB pins as outputs.
  • What is the purpose of a data table how is it
    implemented in PIC assembler and why is it done
    this way?
  • What are the contents of the INTCON register and
    what are their function? (exact bit names and
    locations not required).
  • Briefly explain the advantages of TMRO over a
    software delay.
  • Most PIC16F84 instructions take 1 clock cycle to
    execute. Identify all the instructions which
    take always and which sometimes take longer.
    Explain why they take longer.
  • Write a 1/20 s second nested loop software time
    delay.

10
Notes on Selected Questions
  • TMR0 is the hardware timer. The software time
    delay ties up the processor. Using TMR0 means
    the processor is free to do other things. (It
    isnt faster! )
  • TMR0 overflow is one of the 4 interrupts on our
    processor.
  • The instructions all take one clock cycle except
    instructions which involve a program branch.
    Identifying these is often an exam question.
  • BTFSS and BTFSC and DECFSZ and INCFSZ all take
    one or two clock cycles.
  • BTFSS and BTFSC are useful bit test
    instructions. Test is a bit is set or clear and
    skip (the next line in the program) if the
    condition is satisfied.

11
The Basic Nested-Loop Time Delay
  • This is the 0.2s nested loop time delay from your
    lecture notes.
  • Several exam questions in the past have required
    a time delay that is a simple fraction of 0.2s
    (1/5 s), for example, 0.1s or 1/20 s. These can
    be achieved by simply halving or quartering
    MCOUNT.
  • For 0.2s delay MCOUNT255 (0xFF)
  • For 0.1s delay MCOUNT128 (0x80)
  • For 0.05s delay, MCOUNT64 (0x40)
  • etc.

DELAY MOVLW 0XFF MOVWF MCOUNT GET_N MOVLW 0
XFF MOVWF NCOUNT DEC_N DECFSZ NCOUNT,F GOTO
DEC_N DECFSZ MCOUNT,F GOTO GET_N RETURN
12
Time Delay with Flowchart
  • DELAY MOVLW 0XFF
  • MOVWF MCOUNT
  • GET_N MOVLW 0XFF
  • MOVWF NCOUNT
  • DEC_N DECFSZ NCOUNT,F
  • GOTO DEC_N
  • DECFSZ MCOUNT,F
  • GOTO GET_N
  • RETURN

13
Summary
  • Revision suggestions.
  • Exam suggestions.
  • Writing code in the exam.
  • Common mistakes
  • Revision questions (and notes)

14
Thank You and Good Luck  
 
  • S. I. Woolley
  • Electronic, Electrical and Computer Engineering
Write a Comment
User Comments (0)
About PowerShow.com