Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Select P18452 for the Device name and set the device clock to 8 MHz.Type the following delay program inside the C Code Editor void main()

Select P18452 for the Device name and set the device clock to 8 MHz.Type the following delay program inside the C Code Editor

void main() { asm { MOVLW 4 MOVWF R1 MOVLW 3 N1: MOVWF R2 N2: DECF R2 BNZ N2 DECF R1 BNZ N1 NOP HERE: BRA HERE } }

image text in transcribed

Calculate manually the execution time of the delay program when R1= R2= 0 and compare it with that shown in the last figure

un Tools Help Debug layout Lab List NOP BRA Watch Values Tr thi l $ % 40% I Add X Remove Properties Select variable from list Add All Remove All Search for variable by assembly name void main() MOVZW MOVLW MOVER MOVWE MOVZHO MOVLW 0 NI: MOVER . Ri, Value Start Page X Labic X 0x0016 0x0000 0x0018 OxD7F3 _main Labi.c,2. Labi.c,5 :: 20 Ox001CX000 Labi.c,61 GOOI OXEL Labi.c.7 ? Ox0620 Ox000 Lab2.0,81 NI: 0022 OxE02 Labi.c,9 1: N2: 30 0x0024 0X0602 Lab1.c.10 :: Ox0026 OXELFE Labi.c,11 :: 0x0028 0X0601 Labi.,12 Ox002A OxE1TB Labi.c,132 30 0x002C 0x0000 . Labi.c,241 261 40 HERE: Ox002E 0xD7FE Name RI R2 WREG STATUS 0 0 7 Address Ox0001 Ox0002 OXOFES OxOFDS MOVIE R2,0 22: DECY RE DECY R2, 1, BNE NE ENZ N2 DECF R: DECE DECE Ri, l, o BNE NI ENZ N2 NOP NOP HERB: BRA HERE BRA HERE PC: 0x00002C 98.69 ms Watch Clock Cydes: Current Count: 197,380 Time: 98.69 ms 197,378 98.69 ms v Hints Delta: Stopwatch: Unit A 197,380 98.69 ms Messages Quick Converter EP Errors Warnings Line Message No. 1 1139 0 122 123 O Reset To Zero Message Text mikroCPIC 1618.exe MSF OBG PP18F4520L 011111114-f08 "C:\Users\amabd Dropbox (202... Available RAM: 1515 bytes), Available ROM: 32768 bytes) Compilation Started Compled successfully Code ME Labic Lable Compiled CAUsers amabd Dropbox\20212 444 Lab Lab t\Lab1.ist un Tools Help Debug layout Lab List NOP BRA Watch Values Tr thi l $ % 40% I Add X Remove Properties Select variable from list Add All Remove All Search for variable by assembly name void main() MOVZW MOVLW MOVER MOVWE MOVZHO MOVLW 0 NI: MOVER . Ri, Value Start Page X Labic X 0x0016 0x0000 0x0018 OxD7F3 _main Labi.c,2. Labi.c,5 :: 20 Ox001CX000 Labi.c,61 GOOI OXEL Labi.c.7 ? Ox0620 Ox000 Lab2.0,81 NI: 0022 OxE02 Labi.c,9 1: N2: 30 0x0024 0X0602 Lab1.c.10 :: Ox0026 OXELFE Labi.c,11 :: 0x0028 0X0601 Labi.,12 Ox002A OxE1TB Labi.c,132 30 0x002C 0x0000 . Labi.c,241 261 40 HERE: Ox002E 0xD7FE Name RI R2 WREG STATUS 0 0 7 Address Ox0001 Ox0002 OXOFES OxOFDS MOVIE R2,0 22: DECY RE DECY R2, 1, BNE NE ENZ N2 DECF R: DECE DECE Ri, l, o BNE NI ENZ N2 NOP NOP HERB: BRA HERE BRA HERE PC: 0x00002C 98.69 ms Watch Clock Cydes: Current Count: 197,380 Time: 98.69 ms 197,378 98.69 ms v Hints Delta: Stopwatch: Unit A 197,380 98.69 ms Messages Quick Converter EP Errors Warnings Line Message No. 1 1139 0 122 123 O Reset To Zero Message Text mikroCPIC 1618.exe MSF OBG PP18F4520L 011111114-f08 "C:\Users\amabd Dropbox (202... Available RAM: 1515 bytes), Available ROM: 32768 bytes) Compilation Started Compled successfully Code ME Labic Lable Compiled CAUsers amabd Dropbox\20212 444 Lab Lab t\Lab1.ist

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

2. Record these without judgments, criticisms, or comments.

Answered: 1 week ago