PIC 12F629 gpio internal pull-up/down settings

For general Flowcode discussion that does not belong in the other sections.
Post Reply
mansiukit
Posts: 4
http://meble-kuchenne.info.pl
Joined: Wed Apr 06, 2022 4:48 pm
Has thanked: 1 time
Been thanked: 1 time

PIC 12F629 gpio internal pull-up/down settings

Post by mansiukit »

Hi, I have a difficulty to set the code of gpio internal pull-up/down settings. Anyone can teach me how to set the code? Thank a lot!

BenR
Matrix Staff
Posts: 1901
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 494 times
Been thanked: 668 times

Re: PIC 12F629 gpio internal pull-up/down settings

Post by BenR »

Hello,

The PIC12F629 only has internal pull up resistors but these can be enabled as follows using a C icon.

Code: Select all

OPTION_REG = OPTION_REG & 0x7F;  //Clear GPPU bit enabling pull ups
WPU = 0x11;  //Enable Pullup on GPIO0 & GPIO4 

mansiukit
Posts: 4
Joined: Wed Apr 06, 2022 4:48 pm
Has thanked: 1 time
Been thanked: 1 time

Re: PIC 12F629 gpio internal pull-up/down settings

Post by mansiukit »

BenR wrote:
Thu Jun 16, 2022 9:41 am
Hello,

The PIC12F629 only has internal pull up resistors but these can be enabled as follows using a C icon.

Code: Select all

OPTION_REG = OPTION_REG & 0x7F;  //Clear GPPU bit enabling pull ups
WPU = 0x11;  //Enable Pullup on GPIO0 & GPIO4 
Is it correct? The internal pull up resistors of IOPort 4 is still disable.
Thanks.

Image

BenR
Matrix Staff
Posts: 1901
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 494 times
Been thanked: 668 times

Re: PIC 12F629 gpio internal pull-up/down settings

Post by BenR »

Hello,

You have the C code in between the /* and */ symbols, these are comment blocks and need removing otherwise the code is effectively commented out.

mansiukit
Posts: 4
Joined: Wed Apr 06, 2022 4:48 pm
Has thanked: 1 time
Been thanked: 1 time

Re: PIC 12F629 gpio internal pull-up/down settings

Post by mansiukit »

BenR wrote:
Thu Jun 16, 2022 10:46 am
Hello,

You have the C code in between the /* and */ symbols, these are comment blocks and need removing otherwise the code is effectively commented out.
Thank you so much

Post Reply