logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Draw a block diagram showing a microcontroller used to control a small robot. Include the inputs and outputs of the microcontroller.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Assessment Instructions:

1. You must answer ALL questions.

2. Please ensure you complete your answers in a blue font (not red or black). 

3. The best marks can be earned by giving concise, brief answers that address the questions.

4. You must reference all content used from other sources including course materials, slides, diagrams, etc. Do not directly copy and paste from course materials or any other resources. 

Refer to the referencing section of the EIT eLibrary on Moodle for referencing guides. 

5. Use this document for completing your answers by typing the answers after each question without deleting the question. Make sure that you preserve the original question number format.

6. Do not add extra pictures, etc. as annexures; instead, paste them directly into this answer sheet. Hand-drawn sketches can be inserted after scanning but please ensure that the file size does not become big (more than 10 MB). You must refer to all diagrams and pictures, etc. that you have drawn or pasted in.

7. When saving your document (must be Word format), ensure you include your name in the title: COURSECODE_MODULE#_ASSESSMENTTYPE_VERSION#_YOURNAME 

E.g. DMC_DMCPIC613_WrittenAssessment_v1_JohnSmith 

Unit no. and name: DMCPIC613: Develop PIC programs

Assessment type: Written

 

Assessment Points:

Supply the required answers below in blue font (not red or black). 

You must submit this assessment along with the practical component.

You must answer all questions. 

 

Q1 We want to use a PIC16F84A microcontroller where 2 inputs (to the microcontroller) are to be connected to pins RA0 and RA1 (PORTA) and 3 outputs (from the microcontroller) are to be connected to RB1, RB2, RB3 (PORTB). Explain how configuring these individual pins into input or output can be done.

A1 Student answer:

Two inputs are connected to pins RA0 and RA1

Three outputs are connected to pins RB1, RB2, RB3

Code for the connections:

BCF STATUS, RPO; Bits clear in register

CLRF PORTA; Port A and port B are initialized 

CLRF PORTB; by clearing the bits

BSF STATUS RPO; Port A and port B are located in bank 1

MOV LW OX03; To initialize data directions

MOV WF TR1SA; Set RA <1:0> as inputs

MOV LW 0X00; To initialize data directions

MOV WF; To initialize data directions

MOV WF TR1SB; RB <3:1> configured as output

To configure port pin as an input “logic 1” is written to the corresponding pin. To configure a port pin as an output “logic 0” is written to the corresponding pin. Reset pins are configured as an output

F1 Assessor feedback: Achieved

Q2 You are developing an application that uses 190 bytes of RAM. You have the choice between using PIC16F84A or PIC16F688. Which microcontroller you would select and why?

A2 Student answer:

I would choose the second option PIC16F688 which has 256 bytes of data RAM. The first option PIC16F84A only has 68 bytes of data RAM and this is not enough for the required application which uses 190 bytes of RAM

F2 Assessor feedback: Achieved

Q3 What is the relation between a PIC16XX microcontroller’s clock speed and its power consumption?  

A3 Student answer:

The relationship between a PIC16XX Microcontroller’s clock speed and its power consumption is directly proportional to each other and linearly dependent on each other. The single largest factor in the PIC16XX microcontroller power consumption is the clock speed. The power consumed by a microprocessor is directly proportional to its operating clock speed. According to this, a device operating at the lowest clock speed will produce the maximum power savings. If you decrease the clock speed, usually you can decrease the supply voltage. The microcontroller performance is directly proportional to the clock speed. This means that the power consumption can be reduced but the performance is going to be affected. Higher clock speeds mean higher power consumption, but also more computational power. We can say that the choice of clock speed is a trade off between power consumption and the required computational power.

F3 Assessor feedback: Achieved

Q4 Draw a block diagram showing a microcontroller used to control a small robot. Include the inputs and outputs of the microcontroller. The microcontroller should receive sensor data and should produce outputs to control its motors.

A4 Student answer:

F4 Assessor feedback: Achieved

 

Q5 You are asked to develop a program and test it on a microcontroller. What are the three main steps you would follow to do so (do not include simulation)? For each step name the software and/or hardware tools that are needed to execute it.

A5 Student answer

The three main steps are

1- Write the program code in your computer

2- Compile the code with a compiler for the microcontroller you are using

3- Upload the compiled version of your program to your microcontroller

For the first step we need a higher-level language such as C, C++ or Java.  One of the essential tools needed to program a microcontroller is an integrated development environment (IDE). This software is usually developed by the creators of the microcontroller and contains useful tools to help you program your microcontroller. Common tools found in IDE’s include code editors, compilers, and debuggers. Depending on the application of the microcontrollers, additional features may be added as well. Once a suitable IDE is obtained, you can begin writing code. 

The second step is almost always handled by the IDE. While we typically program microcontrollers in higher level languages, the microcontroller itself runs on assembly. To translate code to a format usable by a microcontroller, a compiler must be used. A compiler is a software tool that takes higher level code and optimizes it for assembly. Assembly provides specific instructions to the microcontroller on what register operations to perform to match the operation of the original code.

For the third step, once your code is written, it must be uploaded to the microcontrollers. Most have USB interfaces, but some smaller microcontrollers require a special hardware to be programmed

 

 

 

F5 Assessor feedback: Achieved

Q6 What is an interrupt?

A6 Student answer:

An interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. Whenever an interrupt occurs, the controller completes the execution of the current instruction and starts the execution of an Interrupt Service Routine (ISR) or Interrupt Handler. ISR tells the processor or controller what to do when the interrupt occurs. The interrupts can be either hardware interrupts or software interrupts.

F6 Assessor feedback: Achieved

Q7 Name the sources of interrupts on a PIC16F84A?

A7 Student answer:

The PIC16F84A has 4 sources of interrupt:

• External interrupt RBO/INT pin

• TMRO overflow interrupt

• PORTB change interrupts (pins RB7:RB4)

• Data EEPROM write complete interrupt

F7 Assessor feedback: Achieved

Q8 Explain how a program is transferred to a PIC microcontroller. Clarify whether the code is transferred as a text or a hexadecimal file.

A8 Student answer:

To program a microcontroller, you need a device called a Burner/Programmer and software (Boot loader). The burner and the dedicated software perform the function of transferring a .Hex file into the PIC. The burner is connected to the PC via a serial cable.

As expressed above the file transferred to the PIC is a Hex file.

F8 Assessor feedback: Achieved

Q9 Why is it important to clear the INTF bit for PIC16F84A microcontroller?

A9 Student answer:

It is important to clear the INTF bit because we don’t want an interrupt to occur again while going back to the main program

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

871 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

739 Answers

Hire Me
expert
Husnain SaeedComputer science

502 Answers

Hire Me
expert
Atharva PatilComputer science

850 Answers

Hire Me