I need the internal pullup resistors enabled on some pins. How do I enable them from flowcode?
..or do I need to do that in C? If so what is the C code that enables them (16f616 chip)
How to enable Internal pullup Resistors in flocode
- 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: How to enable Internal pullup Resistors in flocode
Hello
You enable the PortA pull ups by using the following line of C code.
set_bit( option_reg, 7 );
Note that PortA pullups are only available on pins RA0, RA1, RA2, RA4 and RA5.
I think there is also a way to enable individual pull ups if you didn't want them all enabled.
To do this use the following line of C code.
set_bit( wpua, x );
Where x is the PortA pin you wish to assign the pull up to. Eg 0, 1, 2, 4 or 5.
You enable the PortA pull ups by using the following line of C code.
set_bit( option_reg, 7 );
Note that PortA pullups are only available on pins RA0, RA1, RA2, RA4 and RA5.
I think there is also a way to enable individual pull ups if you didn't want them all enabled.
To do this use the following line of C code.
set_bit( wpua, x );
Where x is the PortA pin you wish to assign the pull up to. Eg 0, 1, 2, 4 or 5.
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