24
hafriz.fi[email protected] 4.0 CIRCUIT SIMULATION Design PIC’s circuit and simulate using simulation software, write the program source code and build (assemble) the program and attach the resulting machine code to the MCU. Hardware testing. EC501 EMBEDDED SYSTEM APPLICATIONS Pg 1

Chapter 4 Circuit Simulation

Embed Size (px)

Citation preview

Page 1: Chapter 4 Circuit Simulation

[email protected]

4.0 CIRCUIT SIMULATIONDesign PIC’s circuit and simulate using simulation software, write the program source code and build (assemble) the program and attach the resulting machine code to the MCU. Hardware testing.

EC501 EMBEDDED SYSTEM APPLICATIONS

Pg 1

Page 2: Chapter 4 Circuit Simulation

4.1.1 Describe the function of main editing window and mode toolbar.4.1.2 Demonstrate picking devices from the library4.1.3 Explain the MCU properties.4.1.4 List all basic components for PIC’s circuit.4.1.5 Drawing the schematic using simulation software.4.1.6 Write the program source code and attach the resulting machine code to the MCU.

4.1 Know simulation environment in simulation software.

Pg 2

Page 3: Chapter 4 Circuit Simulation

4.1 Know simulation environment in simulation software.

Pg 3

Pspice-Cct analysis

National InstrumentMultisim & Ultiboard 10-Limited micro-u, only PIC16F84A-Limited animation

Livewire&PCB wizard-Limited animation-no micro-u

Page 4: Chapter 4 Circuit Simulation

4.1 Know simulation environment in simulation software.

• Melukis dan mereka-bentuk litar/skematik.

• Animasi litar. Analog, digital, graf generator, virtual instrument dll.

• Membina prototaip PCB• 3D-view

Page 5: Chapter 4 Circuit Simulation

4.1.1 Describe the function of main editing window and mode toolbar.

4.1 Know simulation environment in simulation software.

Pg 5

2 – component toolbar, virtual instrument, draw etc

3 – object pick/selector1 – edit toolbar,design toolbar etc

4 – Editing Windows

Page 6: Chapter 4 Circuit Simulation

4.1.1 Describe the function of main editing window and mode toolbar.

4.1 Know simulation environment in simulation software.

Pg 6

New, open, save, print..etc

Toggle grid, zoom in, zoom out, zoom to area..etc

Block copy, block move, block rotate..etc

Toggle wire, add sheet, netlist to Ares..etc

Animation, step animation, pause & stop

Pop-up message

Page 7: Chapter 4 Circuit Simulation

4.1.1 Describe the function of main editing window and mode toolbar.

4.1 Know simulation environment in simulation software.

Pg 7

Cursor

Component mode

Junction dot mode

Buses mode

Text script mode

Wire label

Subcircuit Mode

Terminal Mode

Graph Mode

Devices pin modes

Tape Recorder mode

Generator Mode

Virtual instrument mode

Current probe

Voltage Probe

2D graphics mode

Page 8: Chapter 4 Circuit Simulation

4.1.1 Describe the function of main editing window and mode toolbar.

4.1 Know simulation environment in simulation software.

Pg 8

Page 9: Chapter 4 Circuit Simulation

4.1.2 Demonstrate picking devices from the library

4.1 Know simulation environment in simulation software.

Rotate component, flipBefore put under drawarea

Overview Windows

Pick componentKlik icon Sebelum klik PObject Selector

Page 10: Chapter 4 Circuit Simulation

4.1.3 Explain the MCU properties.

4.1 Know simulation environment in simulation software.

Pg 10

Refer datasheet pic18f458

Page 11: Chapter 4 Circuit Simulation

4.1.4 List all basic components for PIC’s circuit.

4.1 Know simulation environment in simulation software.

Pg 11

Page 12: Chapter 4 Circuit Simulation

4.1.4 List all basic components for PIC’s circuit.

4.1 Know simulation environment in simulation software.

Pg 12

Page 13: Chapter 4 Circuit Simulation

4.1.4 List all basic components for PIC’s circuit.

4.1 Know simulation environment in simulation software.

Pg 13

Page 14: Chapter 4 Circuit Simulation

4.1.4 List all basic components for PIC’s circuit.

4.1 Know simulation environment in simulation software.

Pg 14

Page 15: Chapter 4 Circuit Simulation

4.1.4 List all basic components for PIC’s circuit.

4.1 Know simulation environment in simulation software.

Pg 15

Page 16: Chapter 4 Circuit Simulation

4.1.5 Drawing the schematic using simulation software.

4.1 Know simulation environment in simulation software.

Pg 16

Page 17: Chapter 4 Circuit Simulation

4.1.6 Write the program source code and attach the resulting machine code to the MCU.

4.1 Know simulation environment in simulation software.

Pg 17

LI ST P=18F458#I NCLUDE <P18F458. I NC>

CONFI G WDT=OFF ; Di sabl e wat chdog t i merCONFI G LVP=OFF ; Low- Vol t age pr ogr ammi ng

; di sabl ed ( necessar y f or debuggi ng)

Reg1 EQU 0x300 ; Cr eat e t empor ar y st or age f or del ayReg2 EQU 0x301

ORG 0x00

CLRF TRI SD ; W- - >TRI SDCLRF PORTD ; PORTD=0x00

St ar t I NCF LATD, FCALL Del ayGOTO St ar t

Del ay MOVLW D' 200' ; Del ay f or 250msMOVWF Reg1 ; f or 10MHz cr yst al

D1 MOVLW D' 250'MOVWF Reg2

D2 NOPNOPDECF Reg2BNZ D2DECF Reg1BNZ D1RETURN

END

Page 18: Chapter 4 Circuit Simulation

4.2.1 Demonstrate running the simulation.

4.2 Understand the method to test the design using software simulation software.

Pg 18

Page 19: Chapter 4 Circuit Simulation

4.2.2 Demonstrate how to display source code debug window.

4.2 Understand the method to test the design using software simulation software.

Pg 19

1. Pause the simulation.2. Right click on the uController3. Select PIC18 CPU

Page 20: Chapter 4 Circuit Simulation

4.2.3 Demonstrate how to used virtual instrument to measure circuit performance.a. Voltmeter and ammeterb. Oscilloscope

4.2 Understand the method to test the design using software simulation software.

Pg 20

Page 21: Chapter 4 Circuit Simulation

4.2.3 Demonstrate how to used virtual instrument to measure circuit performance.a. Voltmeter and ammeterb. Oscilloscope

4.2 Understand the method to test the design using software simulation software.

Pg 21

Page 22: Chapter 4 Circuit Simulation

4.2.3 Demonstrate how to used virtual instrument to measure circuit performance.a. Voltmeter and ammeterb. Oscilloscope

4.2 Understand the method to test the design using software simulation software.

Pg 22

Page 23: Chapter 4 Circuit Simulation

1. Create a system that count a number start from 0-5 and than buzzer on and off.

2. Develop a system that “sense” an input from the push button (active low) and the LED will blink for 3 times. (used input at PORTB and output also in PORTB)

3. Build a system that detect an input from push button (active high) and LED in PORTC will rotate left and right several times.

Exercise..

Pg 23