![]()
Specifications of some common PIC's
Device Pins I/O ROM RAM Max. Freq. Voltage range Features P12C508 8 6 max. 512 bytes 25 20 2.5-6.25 TMR0,WDT, SLEEP, Code protection, POR, 2 Level Stack, interrupts, internal oscillator. P12C509 8 6 max. 512 bytes 25 20 2.5-6.25 As P12C508 P16C54 18 12 512 bytes 25 20 2.5-6.25 TMR0, WDT, SLEEP Code protection, POR,2 Level Stack. P16C55 28 20 512 bytes 24 20 2.5-6.25 As P16C54 P16C56 18 12 1kbyte 25 20 2.5-6.25 As P16C54 P16C57 28 20 2kbytes 72 20 2.5-6.25 As P16C54 P16C71 18 13 1kbyte 36 20 3-6 4 A/D channels, 8 Level Stack, Interrupts, +those of P16C54. P16C73 28 22 4kbytes 192 20 3-6 5 A/D channels,TMR1, TMR2, Serial Interface + those of P16C71. P16C84 18 13 1kbyte 36 10 2-6 1K EEPROM, 8 Level Stack, Interrupts, + those of P16C54. Instruction Set for most PIC's
addlw number
- (NOT FOR PIC16C5X SERIES) - adds a number with the number in the working register.addwf FileReg, f
- adds the number in the working register to the number in a file register (FileReg) and puts the result in the file register.addwf FileReg, w
- adds the number in the working register to the number in a file register (FileReg) and puts the result back into the working register, leaving the file register unchanged.andlw number
- ANDs a number with the number in the working register, leaving the result in the working reg.andwf FileReg, f
- ANDs the number in the working register with the number in a file register (FileReg) and puts the result in the file registerbcf FileReg, bit
- clears a bit in a file register (FileReg), i.e. makes the bit 0bsf FileReg, bit
- sets a bit in a file register (FileReg), i.e. makes the bit 1btfsc FileReg, bit
- tests a bit in a file register (FileReg) and skips the next instruction if the result is clear (i.e. if that bit is 0).btfss FileReg, bit
- tests a bit in a file register (FileReg) and skips the next instruction if the result is set (i.e. if that bit is 1).call AnySub
- makes the chip call a subroutine(AnySub), after which it will return to where it left off.clrf FileReg
- clears (makes 0) the number in a file register (FileReg).clrw
- clears the working register.clrwdt
- clears the watchdog timer.comf FileReg, f
- complements (inverts - ones become zeroes, zeroes become ones) the number in a file register (FileReg), leaving the result in the file register.decf FileReg, f
- decrements (subtracts one from) a file register (FileReg) and puts the result in the file register.decfsz FileReg, f
- decrements a file register (FileReg) and if the result is zero it skips the next instruction. The result is put in the file register.goto Anywhere
- makes the chip go to somewhere in the program which YOU have labelled 'Anywhere'.incf FileReg, f
- increments (adds one to) a file register (FileReg) and puts the result in the file register.incfsz FileReg, f
- increments a file register (FileReg) and if the result is zero it skips the next instruction. The result is put in the file register.iorlw number
- inclusive ORs a number with the number in the working register.iorwf FileReg, f
- inclusive ORs the number in the working register with the number in a file register (FileReg) and puts the result in the file register.movfw FileReg or movf FileReg, w
- moves (copies) the number in a file register (FileReg) in the working registermovlw number
- moves (copies) a number into the working register.movwf FileReg
- moves (copies) the number in the working register into a file register (FileReg).nop
- this stands for : no operation, in other words - do nothing, (it seems useless, but it's actually quite useful!)option
- (NOT TO BE USED EXCEPT IN PIC16C5X SERIES) - takes the number in the working register and moves it into the option register.retfie
- (NOT FOR PIC16C5X SERIES) - returns from a subroutine and enables the Global Interrupt Enable bit.retlw number
- returns from a subroutine with a particular number (literal) in the working register.return
- (NOT FOR PIC16C5X SERIES) - returns from a subroutine.rlf FileReg, f
- rotates the bits in a file register (FileReg) to the left, putting the result in the file register.rrf FileReg, f
- rotates the bits in a file register (FileReg) to the right, putting the result in the file register.sleep
- sends the PIC to sleep, a lower power consumption mode.sublw number
- (NOT FOR PIC16C5X SERIES) - subtracts the number in the working register from a number.subwf FileReg, f
- subtracts the number in the working register from the number in a file register (FileReg) and puts the result in the file register.swapf FileReg, f
- swaps the two halves of the 8 bit binary number in a file register (FileReg), leaving the result in the file register.tris PORTX
- (NOT TO BE USED EXCEPT IN PIC16C5X SERIES) - uses the number in the working register to specify which bits of a port are inputs (correspond to a binary 1) and which are outputs (correspond to 0).xorlw number
- exclusive ORs a number with the number in the working register.xorwf FileReg, f
- exclusive ORs the number in the working register with the number in a file register (FileReg) and puts the result in the file register.Assignments of two of the File Registers (option and status)
Option register bit assignments bit no 8 7 6 5 4 3 2 1 - - RTS RTE PSA PS2 PS1 PS0 prescaler
rates0 0 0 1:2 0 0 1 1:4 0 1 0 1:8 0 1 1 1:16 1 0 0 1:32 1 0 1 1:64 1 1 0 1:128 1 1 1 1:256 (P16C5x) Unassigned (P16C71) Port B pull-up Enable
0 - Disabled
1 - Enabled(P12C50x) Enable Wake-up on Pin Change
0 - Enabled : (A change in GP0, 1, or 3 wakes the PIC up from sleep)
1 - Disabled(P16C5x) Unassigned (P16C71) Interrupt Edge Select
0 - External interrupt occurs on positive going edge of signal
1 - External interrupt occurs on negative going edge of signal(P12C50x) Enable Weak Pull-ups
0 - Enabled : (GP0, 1, and 3 float high)
1 - DisabledTimer (TMR0) signal source
0 - if you want to count an internal signal
1 - if you want to count an external signalTimer (TMR0) increment mode
0 - if you want to count up on a negative going edge
1 - if you want to count up on a positive going edgeprescaler assignment:
0 - if you want the prescaler to be used by the timer (TMR0)
1 - if you want the prescaler to be used by the watchdog time (WDT)
Status register bit assignments bit no 8 7 6 5 4 3 2 1 bit label PA2 PA1 PA0 TO PD Z DC C Do not use this bit for anything,
in order to maintain upward compatibility.see PA0 (adjacent) (P16C54 and 55)
Do not use these bits for anything,
in order to maintain upward compatibility.(P16C56 and 57)
00 - Page 0 (000 - 1FF)
01 - Page 0 (200 - 3FF)
10 - Page 0 (400 - 5FF)
11 - Page 0 (600 - 7FF)(P12C7x)
00 - Bank 0
01 - Bank 1Timeout bit.
See table.Power down bit. See table. Zero Flag :
1 : The result was 0
0 : The result wasn't 0Digit Carry/Borrow Flag:
As Carry Flag except
concerning the lower nibbles
of numbers in question.Carry/Borrow Flag:
Reacts to carrying or borrowing
with arithmetic operations, and to
the rrf and rlf instructions.
Timeout and power down registers bit no. 5 4 bit label TO PD Reset caused by... 0 0 WDT wakeup from sleep 0 1 WDT timeout (not during sleep) 1 0 MCLR wakeup from sleep 1 1 Power - up ©1999 Joseph Birr-Pixton
email: [email protected]