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
6
Tutorial (6): Branching and Conditional Instructions in PIC Microcontrollers
18:37
7
Tutorial (5): Logical Instructions in PIC microcontrollers
18:53
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 (4): Arithmetic Instructions in PIC microcontrollers

10 months ago
80

The tutorial presents the following:
- ADDLW k : adds literal and w (w = w+k)
- ADDWF f,d: adds w and f (w= w+f) or (f= w+f)
- INCF f : increment f (f=f+1)
- SUBLW k: subtracts w from literal (w= k-w)
- SUBWF f,d: subtracts w from f (w=f-w) or (f=f-w)
- DECF f: decrement f (f=f-1)
Status register bits Zero, Carry and Digit Carry respond to certain arithmetic instructions.
The Subtract instructions follow a similar pattern to the Add
The Carry bit now, however, acts as a Borrow.
If a subtract occurs and the result is positive, then the Carry bit is ‘set’. If the result is negative, then the Carry bit is ‘clear’

Define two constant and apply the arithmetic operations between them.

Loading 1 comment...