Page 1 of 1

Learn how to use weak pull up in 16F628A

Posted: Fri Jul 01, 2016 8:47 am
by skquah
Hello, I need help..
1) I am a novice in flow code and I am learning how to apply flow code as hobby in my project..
2) Because of flow code, I have bought a license V6 about a couple of months ago..
3) Now, I am trying to eliminate my resistor arrays in my project and to learnt how to use this weak pull up
resistors function from the 16F628A.. I have searched and read a few articles from inside this forum about using c code
to apply in flowcode, the c code is as :-
option_reg = option_reg & 0x7f;
wpub = 0b11111111;

4) Also c code as :-
CODE : SELECT ALL
option_reg = option_reg & 0x7f;

5) I have write the above c code to my V6 project and when I try to compile into hex. there is a error code " 1 " ..
6) I am attaching my V6 flowcode file to see if anyone could help me to alter my mistake so that I can learn on this topic..
Thank you in advance.. <e-mail removed for SPAM protection>

Re: Learn how to use weak pull up in 16F628A

Posted: Fri Jul 01, 2016 9:19 am
by Benj
Hello Skquah,

I think the problem is the "," comma in the Flowcode project filename. If you remove this then is should work as expected.

However you then get an error regarding the wpub register. Looks like it doesn't exist on the 16F628A.

I would recommend looking at the I/O section of the 16F628A datasheet and that should hopefully show you the right register to use to configure the pull-ups on this device.

Re: Learn how to use weak pull up in 16F628A

Posted: Sat Jul 02, 2016 4:14 am
by skquah
Thanks.. I will try that out.. :)

Re: Learn how to use weak pull up in 16F628A

Posted: Sat Jul 02, 2016 5:18 am
by skquah
Hi, Benj
1) After looking at the 16F628A/ 16F648A data sheet.. I manage to figure out the c code that for the weak pull up..
2) I am now attaching the revised flowcode file that successful compile into hex.
3) Next step is to hook up my hardware to use weak pull up..
4) Thanks again, Benj.

Re: Learn how to use weak pull up in 16F628A

Posted: Mon Jul 04, 2016 4:02 pm
by skquah
Hello, all
1) Today, I have tested my hardware circuit with 16F648A ( same data sheet with 16F628A ) chip .. Load with
the flow-code program hex. file ...... Test is successful, and working well on hardware board.
Selector switches, start switch and feed switch, one pt. is connected to pin no. and the other pt. to gnd.
Refer to my attached flow-code file.. This exercise of how to use this weak pull up is a learning to me on
chip 16F628A/ 16F648A..
2) The c code I have learnt and tested is :-
clear_bit ( option_ reg, 7);
option_reg = 0b01111110; // weak pull up is on pin RB1,2,3,4,5 and 6 .. ( no weak pull up for pin RB0 and RB7 )
3) Sorry for not able to attach my hardware board circuitry..
4) So, this tutorial is closed.. Thank you Benj. and those who are learning together with me.. skquah2007@yahoo.com
http://www.matrixtsl.com/mmforums/posti ... 57&t=17776#

Re: Learn how to use weak pull up in 16F628A

Posted: Tue Jul 05, 2016 2:40 am
by skquah
Hi, all
1) Just to complement this learning, I would like to share this image photo to anyone who is interested in
this project/product.. This project is called " 1 GO toner transfer PCB laminator " I am using this laminator
for my hobby to made PCB.. It is very easy, fast and cheaper on cost of PCB..
2) I am attaching the image photo for your viewing.. Thanks for flow-code, Benj, Martin and Dazz.
3) skquah2007@yahoo.com

Re: Learn how to use weak pull up in 16F628A

Posted: Tue Jul 05, 2016 2:43 am
by skquah
Here is the laminator image photo.. skquah2007@yahoo.com