lab report1

Upload: fatilily

Post on 05-Oct-2015

220 views

Category:

Documents


0 download

DESCRIPTION

it is about microcontrollr

TRANSCRIPT

Lab report # 01Fatima Sadiq12pwcse1029Section : BSir Ammad Khalil

Microcontroller:Amicrocontrolleris a small and low-cost computer built for the purpose of dealing with specific tasks, such as displaying information in a microwaveLEDor receiving information from a televisions remote control.Microcontrollersare mainly used in products that require a degree of control to be exerted by the user.

Difference between Microcontroller & Microprocessor:Microprocessors are used to execute big and generic applications, while a microcontroller will only be used to execute a single task within one application. Some of the benefits of microcontrollers include the following:Cost advantage:The biggest advantage ofmicrocontrollersagainst larger microprocessors is that the design and hardware costs are much lesser and can be kept to a minimum. A microcontroller is cheap to replace, while microprocessors are ten times more expensive. Lesser power usage:Microcontrollers are generally built using a technology known as Complementary Metal Oxide Semiconductor (CMOS). This technology is a competent fabrication system that uses less power and is more immune to power spikes than other techniques. All-in-one:A microcontroller usually comprises of a CPU, ROM, RAM and I/O ports, built within it to execute a single and dedicated task. On the other hand, a microprocessor generally does not have a RAM, ROM or IO pins and generally uses its pins as a bus to interface to peripherals such as RAM, ROM, serial ports, digital and analog IO.

How does a Microcontroller work?

Microcontroller has an input device in order to get the input and an output device (such as LED orLCDDisplay) to exhibit the final process.The Television has a remote control as an Input device and the TV screen as the output device.The signal sent from the remote control is captured by the microcontroller. The microcontroller controls the channel selection, the amplifier system and picture tube adjustments such as hue, brightness, contrast etc.

LAB:In lab well use AT89C51 and AT89C52.

Basic Circuit:

Software:We will use keil software.Creating Project:1.Startup the keil2.click on the project -> select new u vision project ->select the ATMEL and Select either AT89C51 or AT89C52 and then ok.3.Then right click on source group and add new file either C or assembly.4:Write a code save it and build it. And then debug it. 5.Select peripheral and port number.6.and Run it.Hex File Generation:1. Right click on source file then selectOptions for Target.2. Select theOutputtab.3. Make sure theCreate HEX Filecheck box is checked.4. Select the proper HEX file format to create (typically this will be HEX-80 for 8051 programs and HEX-386 for large C16x programs).

Then through burner program load the controller with that hex file and check it on bread board.First Program:Code.C#includevoid main(void){ int A; while(1) { A=0xff; P1=A; P2=A; A=0x00; P1=A; P2=A;

}}