Electronic Components Datasheet Search
  Indian  ▼
ALLDATASHEET.IN

X  

PIC16F15213 Datasheet(PDF) 17 Page - Microchip Technology

Part # PIC16F15213
Description  PIC16F15213/14/23/24/43/44 Low Pin Count Microcontrollers
PDF  439 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16F15213 Datasheet(HTML) 17 Page - Microchip Technology

Back Button PIC16F15213 Datasheet HTML 13Page - Microchip Technology PIC16F15213 Datasheet HTML 14Page - Microchip Technology PIC16F15213 Datasheet HTML 15Page - Microchip Technology PIC16F15213 Datasheet HTML 16Page - Microchip Technology PIC16F15213 Datasheet HTML 17Page - Microchip Technology PIC16F15213 Datasheet HTML 18Page - Microchip Technology PIC16F15213 Datasheet HTML 19Page - Microchip Technology PIC16F15213 Datasheet HTML 20Page - Microchip Technology PIC16F15213 Datasheet HTML 21Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 17 / 439 page
background image
5.
Register and Bit Naming Conventions
5.1
Register Names
When there are multiple instances of the same peripheral in a device, the Peripheral Control registers will be depicted
as the concatenation of a peripheral identifier, peripheral instance, and control identifier. The Control registers section
will show just one instance of all the register names with an ‘x’ in the place of the peripheral instance number. This
naming convention may also be applied to peripherals when there is only one instance of that peripheral in the device
to maintain compatibility with other devices in the family that contain more than one.
5.2
Bit Names
There are two variants for bit names:
• Short name: Bit function abbreviation
• Long name: Peripheral abbreviation + short name
5.2.1
Short Bit Names
Short bit names are an abbreviation for the bit function. For example, some peripherals are enabled with the EN bit.
The bit names shown in the registers are the short name variant.
Short bit names are useful when accessing bits in C programs. The general format for accessing bits by the short
name is RegisterNamebits.ShortName. For example, the enable bit, ON, in the ADCON0 register can be set in C
programs with the instruction ADCON0bits.ON = 1.
Short names are not useful in assembly programs because the same name may be used by different peripherals in
different bit positions. When it occurs, during the include file generation, the short bit name instances are appended
with an underscore plus the name of the register where the bit resides, to avoid naming contentions.
5.2.2
Long Bit Names
Long bit names are constructed by adding a peripheral abbreviation prefix to the short name. The prefix is unique
to the peripheral, thereby making every long bit name unique. The long bit name for the ADC enable bit is the ADC
prefix, AD, appended with the enable bit short name, ON, resulting in the unique bit name ADON.
Long bit names are useful in both C and assembly programs. For example, in C the ADCON0 enable bit can be set
with the ADON = 1 instruction. In assembly, this bit can be set with the BSF ADCON0,ADON instruction.
5.2.3
Bit Fields
Bit fields are two or more adjacent bits in the same register. Bit fields adhere only to the short bit naming convention.
For example, the three Least Significant bits of the ADCON2 register contain the ADC Operating Mode Selection bit.
The short name for this field is MD and the long name is ADMD. Bit field access is only possible in C programs. The
following example demonstrates a C program instruction for setting the ADC to operate in Accumulate mode:
ADCON2bits.MD = 0b001;
Individual bits in a bit field can also be accessed with long and short bit names. Each bit is the field name appended
with the number of the bit position within the field. For example, the Most Significant MODE bit has the short bit name
MD2 and the long bit name is ADMD2. The following two examples demonstrate assembly program sequences for
setting the ADC to operate in Accumulate mode:
MOVLW
~(1<<MD2 | 1<<MD1)
ANDWF
ADCON2,F
MOVLW
1<<MD0
IORWF
ADCON2,F
PIC16F15213/14/23/24/43/44
Register and Bit Naming Conventions
© 2020-2022 Microchip Technology Inc.
and its subsidiaries
Data Sheet
DS40002195E-page 17



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com