Question

In: Electrical Engineering

) Design a simple embedded system with PIC16F84A microcontroller (using 20MHz resonator). The system can drive...

) Design a simple embedded system with PIC16F84A microcontroller (using 20MHz resonator). The system can drive a LED light on for 52.6ms on and 26ms off repeatedly. A watchdog timer should be enabled and have a time out period of 72 ms. Sketch the circuit and write the complete assembly program.

Solutions

Expert Solution

Assembly Program:

Basics of PIC 16F84A Microcontroller which is useful to solve this problem

1.It is an 8 bit microcontroller.

2.It has two PORTS named as PORT A and PORT B which are used to interface interface input / output devices.

3.PORT A has 5 I/O pins.

4.PORT B has 8 I/O pins. A total of 13 I/O pins available in PIC 16F84A

5.TRIS register is used to configure these 13 pins as input or output pins.

6.To make all the port A pins as input pins, TRIS A should be set as 1.

7.If TRIS <pinno> = 1 it configures particular pin as input.If TRIS <pinno> = 0 then particular pin acts as output.

Initial assumptions for the given question:

1.let us consider the led light is connected to PORT B5.

2. Initially that particular B5 should be configured as output because microcontroller is driving an led light by supplying 5V.

3.Using TRIS B register configure that particular pin as output, i.e. TRISB5=0.

MAIN PROGRAM:

Program is written in C language

#include<pic.h> / Include all the supported PIC files

#include<htc.h> / Include the hitech compiler files

#define _XTAL_FREQ 20000000 /Define theexternalclock frequency 20 Mhz

void main()

{

TRISB5 = 0 / Configuring the PIN B5 as output pin using TRIS B register

PORTB =0b00000000 / Initially resetting all the pins which means supplying 0V to the led light. b indicates binary. There are 8 pins in port b so all the 8 pins are assigned 0 initially.

WDTE = 1 /Enabling the watch dog timer

OPTION_REG = 0b00001010 / Configuring the watch dog timeout peroid to 72 ms i.e making B0,B1,B2 as 0,1,0 respectively.

while(1) / loop executes continuously

{

WDTON(); / Watch dog timer function is on which implies count starts from 72ms to 0ms

PORTB = 0b00100000 ; / order is 0bB7 B6 B5 B4 B3 B2 B1 B0. In our assumption led light is connected to B5 pin so that B5 pin isset high which implies 5V is suppiled.

__delay_ms(52.6) ; / delay_ms is a function which takes milliseconds as arguments. Here led is turn on and we are delaying the next action by 52.6 ms

PORTB = 0b00000000; / allthe pins are resetted which means led is off

__delay_ms(26) ; /led is off for 26 ms

CLRWDT(); /clearing the counter

}

}

Embedded circuit connection diagram:

1. Here led light is connected to pin 12 i.e. PORT B5.

2.Microcontroller is powered by 5 V power supply which is connected at 16th pin i.e Vdd pin.

3.Ground is connected to Vss pin i.e pin no. 5.

CIRCUIT:


Related Solutions

Design an embedded system using MSP430 to control a traffic light system. It is included a...
Design an embedded system using MSP430 to control a traffic light system. It is included a complete design description of a traffic light system to help you in your design. Show the hardware schematics and the software needed to complete your design.
what are the ingredients to design a security system using Microcontroller MSP 430? and what is...
what are the ingredients to design a security system using Microcontroller MSP 430? and what is the proper flowchart for this system?
Design an embedded system using a MSP430 to create a slot machine. Include a complete description...
Design an embedded system using a MSP430 to create a slot machine. Include a complete description of a slot machine designed using logic circuits. You must submit a complete design with all the hardware and software needs, include a c program that utilizes the msp430 for this.
Design a Digital Voting Machine using microcontroller based device which can be performed in election electronic...
Design a Digital Voting Machine using microcontroller based device which can be performed in election electronic voting system. (You can allow five candidates and 50 users. The overall result of the election should be displayed after all.) Create an algorithm to design a solution Write a programme to implement the given specification selecting an appropriate microcontroller. (Use Assembly or C languages) Please attach schematic diagrams (Circuit diagram).
DTMF home automation system using ATMEGA8 i need the circuit and the code for the microcontroller
DTMF home automation system using ATMEGA8 i need the circuit and the code for the microcontroller
Design a line following robot by using AT89C51 microcontroller, DC motors and line sensors. Use Photo...
Design a line following robot by using AT89C51 microcontroller, DC motors and line sensors. Use Photo transistors and LEDS to design a line sensor. Use DC motos and attach DC motors to Microcontroller by using H-Bridge IC or circuit. Use assembly language for programming. Draw the model and simulate it. Show all the schematics and connections. After Designing Line Follower, convert it into maze solver by using your own algorithm. The robot should start and reach the end point in...
System Analysis and Design please simple your answers as you can and don't copy. Question One...
System Analysis and Design please simple your answers as you can and don't copy. Question One What are the roles of a project sponsor and the approval committee during the different SDLC phases?   Question Two As the project sponsor, you suggested that your company that runs multiple local supermarkets should provide an online shopping service to increase sales during COVID-19 pandemic. Write a system request to propose this project. System request Project Sponsor Business Need Business Requirements Business Value Special...
Design a chain drive for a hammer mill to be driven by a hydraulic drive. the...
Design a chain drive for a hammer mill to be driven by a hydraulic drive. the input speed will be 1200 rpm, and the desired output speed is 335 to 340 rpm, the hammer mill requires 75 hp. lubrication type B should be used and the center distance should not exceed 32 in. mechanical engineering design
Use JAVA to Design a simple registration system that allows Student to register in a course....
Use JAVA to Design a simple registration system that allows Student to register in a course. Requirements using 2 classes: class Student & class Course. Implement the scenarios in class Test’s main method. Each student has a name and an id variable. Each object of class Student is initialized using values of name and id passed to constructor. Class Student has get methods for its instance variables.(getters and setters) Each Course has a name, and a variable numberOfStudent representing the...
An MSP430 microcontroller system is to be designed with the following requirements: The circuit operates from...
An MSP430 microcontroller system is to be designed with the following requirements: The circuit operates from a 5 V supply with a decoupling capacitor. 2 LEDs (IF=15mA, VF = 1.9V) are connected to pins P1.2, P1.3. P1.4 on the microcontroller. These LEDs should have appropriate current limiting resistors and be connected in a sinking arrangement. 1 Push button should be connected to P2.1 using an external pull-up resistor 1 Push button should be connected to P2.2 using the internal pull-up...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT