Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
50 views
17 pages
DEC40053 Embedded System Application
Uploaded by
Iskandar Yussof
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save DEC40053 Embedded System Application For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
50 views
17 pages
DEC40053 Embedded System Application
Uploaded by
Iskandar Yussof
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save DEC40053 Embedded System Application For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save DEC40053 Embedded System Application For Later
You are on page 1
/ 17
Search
Fullscreen
POUT SHnilx MALAYSIA' ELECTRICAL ENGINEERING DEPARTMENT ACADEMIC SESSION: DEC40053 - EMBEDDED SYSTEM APPLICATIONS PRACTICAL WORK 1: INTRODUCTION TO MPLABX AND CIRCUIT SIMULATION PRACTICAL WORK DATE : LECTURER’S NAME: GROUP NO. : TOTAL STUDENT ID & NAME : MARKS, (100%) a 8 @ () DATE SUBMIT : DATE RETURN :LEARNING OUTCOMES (LO) 1. Construct and sinmulate real-time embedded system application based on PICI6F/PICI8F microcontroller effectively OBJECTIVE 1. Write program in C language in MPLABX. 2. Draw and simulate PIC circuit in Proteus. 3. Build output hardware circuit using LEDs THEORY A) MPLAB MPLAB X Integrated Development Environment (IDE) is an expandable, highly configurable software program that incorporates powerful tools to help you discover, configure, develop, debug and qualify embedded designs for most of Microchip’s microcontrollers and digital signal controllers. MPLAB X IDE works seamlessly with the MPLAB development ecosystem of software and tools, many of which are completely free B) PROTEUS Proteus is a design software developed by Labcenter Electronics for electronic circuit simulation, schematic capture and PCB design. Its simplicity and user friendly design made it popular among electronics hobbyists. Proteus is commonly used for digital simulations such as microcontrollers and microprocessors. It can simulate LED, LDR, USB Communication and many more. EQUIPMENT / TOOLS 1. Personal Computer (PC) 2. MPLAB IDE software 3. Proteus software PROCEDURE At desktop, create a folder named P1. In the P1 folder, create subfolder as below. 4 (> et a Quick access Box Sync I Desktop Documents } Downloads circurt REFERENCE seeOpen MPLAB X. Click File>New Project or New Project icon. File Edit View Navigate Source Refactor Production F) New File. CteleN GF openroject.. Cte shiteo Open Recent Projac Import > Ea File Edit View Navigate Source Refactor Production AGgS Se ‘Step I>Choose Project. Select Microchip Embedded option in Categories and Standalone Project in Projects. Click Next (Brent Pex omit eget 1B vee naan moet, 1B treyromt Bingen res rect 1B inert tte aco rom [cestes nen score scat conc. Russ DE greeted bilaStep 2>Select device. Select All Families in Family option. In device option, select suitable PICISE microcontroller (PIC18F45K22). Click Next. i 2] ES ey [ea] [ee
New>main.c Ears File Edit View Navigate Source Refactor Production Debug Team Tools Window Help BES OG be AT -B > EE wee = ult Projects x) Files | Classes Gi|{ StatPave New Logical Folder B csource File. 4 Ad xing Rem Gimme Add Existing Items from Folders... Bl xc header. Find. B owmaine i 3.11 | At file name, type LED. In extension, option c is default selection. Ignore other option, ‘casted C/UsevES AiG DedioePIPWLUED.C ea] SS Ce] oe) Bz | A file named LED will appear below Source Files. (Projects x] Files | Classes o@ pm313 ‘A window named LED. will appear as below. This is where you will write your source code. Seaeoe = 53.22 Oise eee [asm enter an 4 [See alasrsiveciadeuaae ! ue 1 ' ' ' ' ML , Check seiting for your compiler. Click Project Properties at dashboard or click File>Project Properties>XC8 Global option. At C Standard, select C90. [BB new Pj. conesniten a as ape nm 1 ae a= sp mt nn Fea = . fess a BU YF Settnge ne rereaeencon cm Pees Sear 1 8 Sise sonore hoe Pees a omme = a ; =e Grea tirapat nner re sess Pej Prparie PW) sects3.15 | Copy and paste program given in Appendix A into your coding window. Modify the void main (void) block with the source code below. void main (void) { setup(); Ising t ddr >1 TRISBbits.TRISBO while (1) Loox ver { LATBbits . LATBO=. } } File Edit View Navigate Source Refactor Production Debug Team Tools Window Help ASS |} © (co iinaainrget BH Clean and Build Main Project. Shift+F11 Batch Build Main Project... Set Project Configuration > Set Main Project > ‘Set Configuration Bits Check File AlteF9 Validate File Alte Shift+F9 ado Repeat Build/Run Cte FIT Stop Build/Run Tao tn Hop i ee [Build Main Project FT) |p{If your program has no error, you will get BUILD SUCCESSFUL statement in output window as below. If your program has error, you will get BUILD FAILED statement. Double click the error message and fix your program, 1D simulator = Trace/Proting PW (ul ond) = [BUILD SUCCESSFUL (eotal time: 122) Loading code trom ¢:/Users/E5-4715/Deskep/D1/PUL.X/dist/detasic/prodsction/FWL.x. production hex. 8.18 | Double click Proteus 8 Professional icon, Then click ISIS icon as Figure 18. SD: as EE a (o¢a9 deb ae hea * PROTEUS DESIGN SUITE 8.0 5.19 Untitled Proteus 8 Professional-Schematic Capture work area will appear as below. Select button P or Pick parts from libraries icon. 3 LWTTED rie 8 Peon Shana Cp ay Tie Cat Wow Too! Dagh Gaph eh Uy Tenlae Spon tip : | O6B9 Gmmasmo= (0 BR\++4909 Oe KOS Semm ae { HonePage (El Schematic Captre x m Benet e10. | Pick Device window will appear. This is where you can select your components for simulation. You can type the components name in Keywords box or you can select in Category option, Double click your left mouse to select components below: © Microprocessor ICs > PICISF Family > PICI8F45K22 * Resistors > 0.6W Metal film > MINRES330R © Optoelectronics > LEDs > LED-RED » >) + e a (@@_cevces LED-RED MINRES2208 [aBESZ oe + ‘When all components are selected, click Cancel button to go back to ISIS window.Save this circuit as LAB. PICTEFIORDD U1 RAOIC12INO/ANO RAWICI2INIIANI RAZIC2INW/AN2;DACOUTVREF- RAQICIINWANSVREF+ RAAICIOUTISRTOGK! RASIC2OUTISRNQ'SST/HLVDINANS RABICLKOIOSC2 RATICLKUIOSC1 RBOIINTOFFLTO'SRVANI2 RBY/INTUCI2INS/ANTO RBZIINT2/CTEDI/ANS. RB3ICTEDUP2A/CCP2ICI2IN2/ANO RBAIOCOTSGIANTT RBSIOCTPSAICCP3TSCKUTIGIANTS RBBIOCAPGC RB7/IOCSPGD 2/9) we aa t He 2)? Seam on DEFAULT 2. iter & fjSyt [por Oo ' as ~D Terminals Mode @ wrt 4 i ' Construct circuit shown in Figure 23. To set power and ground source, select Terminal Mode > Power and Ground. Click Instruments icon and select DC Voltmeter. ROUP2BITSCKUT3GITICKUSOSCO RC1/P2AICCP2/SOSCI ROZICTPLSIP1AICCPITSCKLAN'4 RCSISCKSCLIANIS RCAISDIVISOAWAN1S, ROSISDOWANI7 ROBTXY/CKVANTS RCTIRXUDTHVANI9 RDOISCK2/SCL2/AN20 RDIVCCP4/SDI2/SDAZIAN21 RD2P2BIAN22 ROBPZGSSIANZS RDAIP2D/SDO2/AN24 ROSP1BIAN25 RDGIP1C/TX2ICKZIANZS RD7IPID/RX2DT2IANQT REOPSAICCPSIANS REWP3BIANG REZICOPSIANT NCTRVPPIRES INSTRUMENTS OSCILLOSCOPE LOGIC ANALYSER COUNTER TIMER VIRTUAL TERMINAL SPI DEBUGGER. 2c DEBUGGER SIGNAL GENERATOR PATTERN GENERATO| DC AMMETER, AC VOLTMETER JAC AMMETER, To save your circuit, select File > Save Project As. Go to Desktop » Pl Folder > CIRCUIT sub folder.Double click your PICISF45K22. Edit component window will appear as below. At Processor Clock Frequency, set 64MEIZ. Past Reference: ut Hiddere [] OK ] Pat abe CuaFaska2 Hide: C1 | ap Element: New Daa ce Package: ila Hider) | | Hidden Pie ProgenFie, LG Heat S| Fete eaMH2 Hide aly 1) Processor Clock Frequency a ‘Advanced Properties: Force ADC Breakpoint At Sample Time? | (Defaut) ©) Hide Aly Other Properties: (Exclude from Simulation DAtach hierarchy module (DE molude from PCB Layout Hide common pins (CE welude from Bil of Materials COE Git al properties as text Load the hex file into Proteus. In MPLAB X, at the output window, copy the statement below and paste in program file in Proteus. Outut = WD Simatator = Trace/Profing = PW (Build, toad) x sore svoceser (Ie TAZ, y Lansing code 2=] €:/Usera/$5-4710/Deakop/PI/PAl_X/dtat/detasle/production/PH1 X production hed I a Hier: C) [riers die New iLan S| [Rite S TE Aisonie5 471670 eshion? [Hide A v Processor Clock Fiequeney aie VieTo run your circuit, click Debug > Run Simulation or click the Run Simulation button at the bottom left of your ISIS window. To stop simulation, click Stop The Simulation button, [Beit] Ubon Template system Help ID) stort si Debuaging caer Run Simulation (timed breakpoint) ‘Write new programming to do task below. Right click Source File>New>main.c. In File Name option, type LED2. Stage tame and cation 3 Romeand ton Femeet [ese rom: Pit ee | Pere ened le: Uses ies PAP HLL Remove LED.c code from Source Files. Right click LED.c name below Source Files=Remove From Project. Popa rie dees = ce te concn Compt te event a" , wo 5 SE pepe: pause‘Make sure only LED2.¢ code remain below Source Files. [Projects =| Files | Classes G pw. © GD) Header ries @-(G Important Fes @( Unker Fes GB} Source Fes Sma (i Ubraries (HP Loodables 5.26 | Write the source code below for LED2.< program, void main (void) { setup()7 ir program idx k t Por v } Build your LED2.¢ code 527 ‘Draw cireuit for LED2.c program and simulate them in Proteus.6 [Task Build C program to perform task below. Design its circuit in Proteus. State your observations. a) Make Port D produce SV. Use bit addressable instructions. b) Make pin RB7, RBS, RB3 and RBI ON and other Port B pins OFF. Use byte addressable instruction, ©) Make REO, RAI, RB2, RC3 and RD4 HIGH, 7 | RESULT 8 | DISCUSSION 9 | CONCLUSIONAppendix A include
#define_XTAL_FREQ 640000001 void setup(void); void delay(unsigned int x); void main (void) semup(); ‘Your program start here /Your program end here BAHAGIAN INI JANGAN KACAU :) void setup(void) ANSELA = 0000000000; 200000000, 100000000: ‘ob00000000: ANSELE = 0600000000; VREFCONO = 0610110000; // Fixed Voltage Reference is enabled, x4 (4.096V) ADCONI = 0600110000; (0001 10000=4.096V 0b00100000=2,048V 0'00000000=Vadd ADCON? = 0610000011. 1x00; 1x00; 1x00; LATD = 0x00; LATE = 0x00, void delay(unsigned int x) for(:x>0; |_delay_ms(1) static void interrupt ISR(void)
You might also like
Full Lab Manuals Updated On 11 July 2024
PDF
No ratings yet
Full Lab Manuals Updated On 11 July 2024
61 pages
Introduction To Proteus PDF
PDF
No ratings yet
Introduction To Proteus PDF
6 pages
Electrical Engineering Department Academic Session:: Dec40053 - Embedded System Applications
PDF
100% (1)
Electrical Engineering Department Academic Session:: Dec40053 - Embedded System Applications
21 pages
Proteus Simulation Program: FIG 1: PIC C Start Screen. FIG 2: The Body of Any Program. FIG 3: Compile Confirmation
PDF
100% (1)
Proteus Simulation Program: FIG 1: PIC C Start Screen. FIG 2: The Body of Any Program. FIG 3: Compile Confirmation
5 pages
Embedded Systems
PDF
No ratings yet
Embedded Systems
28 pages
TP N°1 - Prise en Main de MiKroC Pro For PIC
PDF
No ratings yet
TP N°1 - Prise en Main de MiKroC Pro For PIC
20 pages
Lab 1-4 - Reports
PDF
No ratings yet
Lab 1-4 - Reports
29 pages
MikroC PRO For PIC
PDF
100% (2)
MikroC PRO For PIC
20 pages
Mplab Xc16 User'S Guide For Embedded Engineers Mplab XC16 User's Guide For Embedded Engineers
PDF
No ratings yet
Mplab Xc16 User'S Guide For Embedded Engineers Mplab XC16 User's Guide For Embedded Engineers
36 pages
Lab2a - RGB LED PDF
PDF
0% (1)
Lab2a - RGB LED PDF
18 pages
MPLAB Tutorial Using Assembly Language For The PIC16F877 Wit
PDF
No ratings yet
MPLAB Tutorial Using Assembly Language For The PIC16F877 Wit
23 pages
Embedded Lab Journal Fall2024
PDF
No ratings yet
Embedded Lab Journal Fall2024
111 pages
Report1 Embeded Wong Setel
PDF
No ratings yet
Report1 Embeded Wong Setel
7 pages
Programming The PIC Micro Controller: Computer Organization CS 140
PDF
No ratings yet
Programming The PIC Micro Controller: Computer Organization CS 140
16 pages
ES Lab Journal Fall 2023
PDF
No ratings yet
ES Lab Journal Fall 2023
97 pages
CCS - Embedded C Language For PIC
PDF
100% (2)
CCS - Embedded C Language For PIC
44 pages
Microchip Minutes: Helloworld Application Lab: Hardware
PDF
100% (1)
Microchip Minutes: Helloworld Application Lab: Hardware
15 pages
Up Student Book
PDF
No ratings yet
Up Student Book
86 pages
Embedded System Report 1 (Assembly Language)
PDF
100% (5)
Embedded System Report 1 (Assembly Language)
10 pages
Micro Controller For Beginners
PDF
No ratings yet
Micro Controller For Beginners
11 pages
Electrical Engineering Department Practical Work 1
PDF
No ratings yet
Electrical Engineering Department Practical Work 1
35 pages
Quickguide Proteus
PDF
No ratings yet
Quickguide Proteus
7 pages
Sahil Es
PDF
No ratings yet
Sahil Es
27 pages
Embedded Pw1 Izwan.
PDF
No ratings yet
Embedded Pw1 Izwan.
20 pages
Ds 50002400 B
PDF
No ratings yet
Ds 50002400 B
30 pages
Pratham
PDF
No ratings yet
Pratham
20 pages
Bee31101 Lab2 v20142015
PDF
No ratings yet
Bee31101 Lab2 v20142015
17 pages
Lab1 PDF
PDF
No ratings yet
Lab1 PDF
24 pages
PW1 Labsheet Embd System Faiz
PDF
No ratings yet
PW1 Labsheet Embd System Faiz
26 pages
Universiti Malaysia Perlis: School of Electrical Systems Engineering
PDF
No ratings yet
Universiti Malaysia Perlis: School of Electrical Systems Engineering
17 pages
Tutorial For NXP S32 Design Studio: Starting Out - Creating A Workspace
PDF
No ratings yet
Tutorial For NXP S32 Design Studio: Starting Out - Creating A Workspace
17 pages
Embeded 11
PDF
No ratings yet
Embeded 11
23 pages
A UEEA2634 2024 Exp1
PDF
No ratings yet
A UEEA2634 2024 Exp1
15 pages
Experiment No 2
PDF
No ratings yet
Experiment No 2
9 pages
Getting Started With MPLAB (PIC Assembler and Simulator) For PIC12F508 Assembly Language Programming
PDF
No ratings yet
Getting Started With MPLAB (PIC Assembler and Simulator) For PIC12F508 Assembly Language Programming
10 pages
ES Lab File
PDF
No ratings yet
ES Lab File
12 pages
Lab - MP Reports 8-9 Microprocessor
PDF
No ratings yet
Lab - MP Reports 8-9 Microprocessor
12 pages
2023 Fall Microcomputer Laboratory Exp 1
PDF
No ratings yet
2023 Fall Microcomputer Laboratory Exp 1
10 pages
Lab Handout#02 Solved
PDF
No ratings yet
Lab Handout#02 Solved
14 pages
Lab 2.1
PDF
No ratings yet
Lab 2.1
11 pages
Experiment No.2
PDF
No ratings yet
Experiment No.2
9 pages
FSB23203 - Lab 0
PDF
No ratings yet
FSB23203 - Lab 0
11 pages
Lab Work 4: PIC Programming in C
PDF
No ratings yet
Lab Work 4: PIC Programming in C
7 pages
Procedure of Pic
PDF
No ratings yet
Procedure of Pic
3 pages
Integrated Circuit Debugger and Target Board Module (ICD/TB)
PDF
No ratings yet
Integrated Circuit Debugger and Target Board Module (ICD/TB)
10 pages
Add8 (Just A Name) in The Main Directory RT. Create A New Directory in E Drive in Your Name, Say RT
PDF
No ratings yet
Add8 (Just A Name) in The Main Directory RT. Create A New Directory in E Drive in Your Name, Say RT
6 pages
A Guide To Simulating and Programming PIC Microcontrollers Using The MPLAB IDE Program
PDF
No ratings yet
A Guide To Simulating and Programming PIC Microcontrollers Using The MPLAB IDE Program
7 pages