1
Tutorial (9): Creating arrays using indirect addressing in PIC microcontrollers
13:31
2
Tutorial (8): Creating arrays using lookup tables in PIC microcontrollers
17:33
3
Tutorial (7): Creating Software Delay and Hardware Delay in PIC Microcontrollers
51:46
4
Experiment (4): Interrupts in PIC microcontroller
18:26
5
Experiment (3): Creating software delay in PIC microcontroller
28:14
Tutorial (6): Branching and Conditional Instructions in PIC Microcontrollers
18:37
7
Tutorial (5): Logical Instructions in PIC microcontrollers
18:53
8
Tutorial (4): Arithmetic Instructions in PIC microcontrollers
27:16
9
Tutorial (3): PIC input/Output Ports with Addition
36:23
10
Tutorial (2) Using Output ports in PIC microcontrollers
15:14
11
Tutorial (1): How to download and install MPLAB of PIC microcontrollers
10:39

Tutorial (6): Branching and Conditional Instructions in PIC Microcontrollers

10 months ago
80

* One of the most important features of any microprocessor or microcontroller program is its ability to make ‘decisions’.

* Microprocessors generally have within their instruction sets a number of instructions which allow them to test a particular bit, and either continue program execution if a condition is not met or branch to another part of the program if it is.

1) Tests bit b in memory location f and skips just one instruction if the bit is clear.
BTFSC f,b: Bit Test f, Skip if Clear

2) Tests bit b in memory location f and skips just one instruction if the bit is set.
BTFSS f,b : Bit Test f, Skip if Set
3) DECFSZ f,d: Decrement f, Skip if 0
4) INCFSZ f,d: Increment f, Skip if 0

Loading comments...