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...
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...
The Electron Transport System consists of a series of enzyme complexes that are embedded in the...
The Electron Transport System consists of a series of enzyme complexes that are embedded in the inner mitochondrial membrane. Which one of the following statements is NOT TRUE of mitochondria or the electron transport chain? a. Tissues that run aerobic metabolism are enriched in mitochondria. b. Glycolysis, the first stage of carbohydrate breakdown, occurs in the inner mitochondrial membrane. c. Coenzyme Q10 is a critical electron carrier imbedded in the inner mitochondrial membrane. d. The Electron Transport System is the...
A boarding school in your area has asked you to design a simple system so that...
A boarding school in your area has asked you to design a simple system so that they could easily identify the students who are staying in the hostel rooms as well as the wardens who are in charge of each student blocks. Each staff may be in charge of guarding a hostel block. This is not permanent because after certain duration the staff will change blocks. The guarding duty is rotational and not all the staff are required to do...
Using your own words, create a simple single-subject study using a reversal design to answer a...
Using your own words, create a simple single-subject study using a reversal design to answer a question about a behavior of interest. Describe hypothetical results.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT