Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Chapter 6 - Programming Techniques > Questions 6 - Pg. 142

142 Chapter 6 For full details on topics in this chapter related to the assembler, refer to the `MPASM User's Guide' at www.microchip.com. Questions 6 1. State (a) the number of clock cycles in a PIC instruction cycle, and the number of instruction cycles taken to execute the instructions (b) CLRW and (c) RETURN. 2. If the PIC clock input is 100 kHz, what is the instruction cycle time? 3. Calculate the preload value required in TMR0 to obtain a delay of 1 ms between the load operation and the T0IF going high, if the clock rate is 4 MHz and the prescale ratio selected is 4:1. 4. List the bits in the SFRs that have to be initialized to enable an RB7:RB3 interrupt. 5. State one advantage each of the RC, X T, HS and INTOSC clock options. 6. State the assembler directive that must be used in all PIC programs. 7. Explain the difference between a subroutine and a macro, and one advantage of each. Answers on pages 420e1. (3) (2) (3) (2) (4) (2) (4) (Total 20 marks) Activities 6