-
Notifications
You must be signed in to change notification settings - Fork 73
Disable Pull up resistors
This page caused by LDmicro Forum - Disable Pull-up resistor
See also Pull up resistors
a) 8-bit Atmel Microcontrollers:
MCUCR – MCU Control Register.
Bit – PUD: Pull-up Disable.
When this bit is written to one, the I/O ports pull-up resistors are disabled even if the DDxn and PORTxn Registers
are configured to enable the pull-up resistor ({DDxn, PORTxn} = 0b01).
MCUCR address is 0x55. See datasheet for detail.
PUD bit differs for various MCU's:
PUD bit is 4 for ATmega1281, ATmega1284P, ATmega164P, ATmega168, ATmega16U4, ATmega2560, ATmega2561, ATmega324P, ATmega324PA, ATmega328P, ATmega32U4, ATmega48, ATmega640, ATmega644, ATmega88, etc.
Use once SetBit(0x55, 4) instruction to disable all pull up resistors.
PUD bit is 2 for ATmega128, ATmega16, ATmega162, ATmega32, ATmega64, ATmega8, ATmega8515, etc.
PUD bit is 6 for ATtiny85, etc.
b) 8-bit PIC Mid-Range Microcontrollers:
For PIC16F628, PIC16F72, PIC16F819, PIC16F873, PIC16F874, PIC16F876, PIC16F877, PIC16F88, PIC16F882, PIC16F883, PIC16F884, PIC16F886, PIC16F887:
OPTION_REG address is 0x81 – OPTION REGISTER.
RBPU bit is 7 - PORTB Pull-up Enable bit. When RBPU bit is written to one, then all PORTB pull-ups are disabled.
Use once SetBit(0x81, 7) instruction to disable all PORTB pull up resistors.
c) 8-bit PIC Enhansed Mid-Range Microcontrollers:
PIC16F1XXX microcontrollers allow individual configuration of weak pull-ups for pins. See datasheet for detail.
bits 7-0 WPUx<7:0>: Weak Pull-up Register bits: 1 = Pull-up enabled, 0 = Pull-up disabled
WPUA address is 0x20C for PIC16F1824, PIC16F1827
WPUB address is 0x20D for PIC16F1512, PIC16F1513, PIC16F1516, PIC16F1517, PIC16F1518, PIC16F1519, PIC16F1526, PIC16F1527, PIC16F1827, PIC16F1933, PIC16F1947
WPUC address is 0x20E for PIC16F1824
WPUD address is 0x20F for PIC16F1526, PIC16F1527
WPUE address is 0x210 for PIC16F1512, PIC16F1513, PIC16F1516, PIC16F1517, PIC16F1518, PIC16F1519, PIC16F1526, PIC16F1527, PIC16F1933
WPUG address is 0x48D for PIC16F1526, PIC16F1527, PIC16F1947
Use once MOV(WPUx, 0) to disable all PORTB Pull up resistors.
Use once ClrBit(WPUx, BITx) to disable only one bit.
For example: Disable only BIT7 and BIT0 of PORTB Pull up resistors.
See also Pull down resistors
UPD: In LDmicro Release 5.3.0.4 added menu Settings->Set Pull-up input resistors.
Any questions to LDmicro.GitHub@gmail.com