tut-ch4-1-port-solutions.pdf - 300044 Microcontrollers PLCs(Microcontrollers Tutorial Solutions \u2013 week 11 Chapter 4 \u2013 Parallel Port 1 What is the

# tut-ch4-1-port-solutions.pdf - 300044 Microcontrollers...

• Homework Help
• 3

This preview shows page 1 - 2 out of 3 pages.

1 300044 Microcontrollers & PLCs ( Microcontrollers ) Tutorial Solutions – week 11 Chapter 4 – Parallel Port 1. What is the delay value produced by the delay segment of List 4.2 for F OSC = 30 MHz? List 4-2: (LED blinking, file name: blinkch4) cblock 0x070 ; shared memory location that is accessible from all banks Delay1 ; Define two file registers for the delay loop in shared memory Delay2 endc movlw d’0’ movwf Delay1 movwf Delay2 OnLoop: decfsz Delay1, f ; Waste time bra OnLoop ; The Inner loop takes 3* 256 = 768 instruction cycles decfsz Delay2, f ; The outer loop takes an additional ; 3 instruction cycles per lap * 255 loops bra OnLoop ; (768+3) * 256 = 197376 Solution : The length of one instruction cycle is equal to T=4/ F OSC = 4/30M=(2/15) μs. Using the formula in the program, the delay value is 197376×T=26.3168 ms. 6. What are states (input vs output and analogue vs digital) for a port pin, at Reset? Solution : At Reset, all port pins are in analogue input mode. Write instructions to complete the tasks in the following questions. Note that you are required to configure ports in each question.

#### You've reached the end of your free preview.

Want to read all 3 pages?

• Three '19

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern