enabling weak pull up
-
- Posts: 53
- Joined: Wed Feb 25, 2015 1:31 pm
- Has thanked: 15 times
- Been thanked: 4 times
- Contact:
enabling weak pull up
in PIC12F615, kindly advise how to enable single port pin GP3 as weak pull up.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: enabling weak pull up
You will need to use a C code block.
The C code will have to be in lower or upper case depending on your version of Flowcode.
What is your version of Flowcode?
The C code will have to be in lower or upper case depending on your version of Flowcode.
What is your version of Flowcode?
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: enabling weak pull up
Hello,
In the device datasheet there is this in the notes regarding the weak pullups.
Flowcode 6 and previous
Flowcode 7 and after
In the device datasheet there is this in the notes regarding the weak pullups.
Not sure if this means GP3 weak pullup is only on when the global GPPU bit is set or on anyway but the C code to set the GPPU bit would look like this.1: Global GPPU must be enabled for individual pull-ups to be enabled.
3:The GP3 pull-up is enabled when configured as MCLR in the Configuration Word, otherwise it is disabled as an input and reads as ‘0’.
Flowcode 6 and previous
Code: Select all
option_reg = option_reg | 0x80;
Code: Select all
OPTION_REGbits.GPPU = 1;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: enabling weak pull up
Hi Ben,
As it'sI thought GPPU has to be cleared for WPU to be enabled?
As it's NOT GPPU it should be:
I don't believe GP3 has a weak pull-up that works?
All the other pins do.
As it's
Code: Select all
NOT GPPU
causes an errror:Benj wrote:OPTION_REGbits.GPPU = 1;
Code: Select all
12F615 Weak pull ups .c: main()
77: OPTION_REGbits.GPPU = 1;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S50
(908) exit status = 1
Code: Select all
OPTION_REGbits.nGPPU = 1;
All the other pins do.
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: enabling weak pull up
Aha yes I missed the line, negating the operation
Thanks for checking
Thanks for checking
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel