Learn how to use weak pull up in 16F628A

A collection of posts and articles on getting started in Flowcode v6

Moderator: Benj

Post Reply
skquah
Posts: 39
Joined: Fri Dec 12, 2014 3:57 pm
Has thanked: 26 times
Been thanked: 10 times
Contact:

Learn how to use weak pull up in 16F628A

Post 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>
Attachments
Laminator triac, weak pull up.fcfx
(25.34 KiB) Downloaded 323 times

User avatar
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: Learn how to use weak pull up in 16F628A

Post 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.

skquah
Posts: 39
Joined: Fri Dec 12, 2014 3:57 pm
Has thanked: 26 times
Been thanked: 10 times
Contact:

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

Post by skquah »

Thanks.. I will try that out.. :)

skquah
Posts: 39
Joined: Fri Dec 12, 2014 3:57 pm
Has thanked: 26 times
Been thanked: 10 times
Contact:

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

Post 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.
Attachments
Laminator triac weak pull up.fcfx
(25.45 KiB) Downloaded 309 times

skquah
Posts: 39
Joined: Fri Dec 12, 2014 3:57 pm
Has thanked: 26 times
Been thanked: 10 times
Contact:

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

Post 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#

skquah
Posts: 39
Joined: Fri Dec 12, 2014 3:57 pm
Has thanked: 26 times
Been thanked: 10 times
Contact:

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

Post 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
Attachments
Laminator control PCB (1).PNG
1 Go passed, toner transfer laminator
(609.76 KiB) Downloaded 4622 times

skquah
Posts: 39
Joined: Fri Dec 12, 2014 3:57 pm
Has thanked: 26 times
Been thanked: 10 times
Contact:

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

Post by skquah »

Here is the laminator image photo.. skquah2007@yahoo.com
Attachments
20160620_135151.jpg
Laminator used for PCB making
(1.16 MiB) Downloaded 701 times

Post Reply