pic 16f1788

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
Philc
Posts: 3
http://meble-kuchenne.info.pl
Joined: Sun Jun 23, 2024 9:46 am
Has thanked: 2 times

pic 16f1788

Post by Philc »

i have this problem with this program looping when it shouldn't, i have 12 leds on output B0 to B7 and C4 to C7, now when i turn them on one at a time its fine, if i then turn off all port B and then use port masking to turn off C4 to C7 the program turns off the leds but loops back and turns them all on again one at a time. The only way i can get it to work correctly is if i turn off C4 then C5 then C6 then C7 and it works perfectly. Any ideas and i also put a counter in so i could control it turn on the next level of 12 leds and that wouldn't work unless i turned C port off individually. what i am playing about with is a led tower 12 leds in rows and 12 high, like the ones off ebay but i am only using the first 2 rows until i get the hang of flowcode. Hopefully its just me but i have tried everything and cant get it to work unless port c turned off individually. I even tried turning off all port C and it still looped when i have no loops or connection point in to make it do that. By turning off i mean output 0. Thanks

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: pic 16f1788

Post by chipfryer27 »

Hi

If you post your chart we can have a look. Without it we have no way of knowing what is going on.

Regards

Philc
Posts: 3
Joined: Sun Jun 23, 2024 9:46 am
Has thanked: 2 times

Re: pic 16f1788

Post by Philc »

how do i attach the chart ? i have tried and cant get it to attach. thanks

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: pic 16f1788

Post by chipfryer27 »

Hi

I you click the "Full Editor & Preview" button, you can then either drag and drop or select files to attach.

Regards

Philc
Posts: 3
Joined: Sun Jun 23, 2024 9:46 am
Has thanked: 2 times

Re: pic 16f1788

Post by Philc »

i have attahed it but dont know where its gone, the bit of the code is the port c oof bit, it runs fine in the debug but doesnt on the chip unless prot c is turned off individually then its fine..



Declare Connection PointDeclare Connection Point: : B
----------------------------------------

----------------------------------------
Output:

off -> C3
----------------------------------------

----------------------------------------
Declare Connection PointDeclare Connection Point: [A]: A
----------------------------------------

----------------------------------------
Calculation:

count = count + 1
----------------------------------------

----------------------------------------
Delay:

10 ms
----------------------------------------

----------------------------------------
Output:

on -> C4
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> C5
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> C6
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> C7
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> B0
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> B0
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> B1
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> B2
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> B3
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> B4
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> B5
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> B6
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

on -> B7
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

off -> PORTB
----------------------------------------

----------------------------------------
Output:

off & 0xF0 -> PORTC
----------------------------------------

----------------------------------------
Delay:

100 ms
----------------------------------------

----------------------------------------
Output:

off -> C2
----------------------------------------

----------------------------------------
Decision:

If count > 1 ?
<TRUE BRANCH>

----------------------------------------
Decision:

If count = 3 ?
<TRUE BRANCH>

----------------------------------------
Input:

C3 -> off
----------------------------------------

----------------------------------------
Input:

C2 -> off
----------------------------------------

----------------------------------------
Input:

C1 -> off
----------------------------------------

----------------------------------------
Delay:

10 ms
----------------------------------------

----------------------------------------
counter reset:

count = 0
----------------------------------------

----------------------------------------
Goto Connection PointGoto Connection Point: : B
----------------------------------------

</TRUE BRANCH>


<FALSE BRANCH>

----------------------------------------
Input:

C2 -> off
----------------------------------------

----------------------------------------
Delay:

10 ms
----------------------------------------

----------------------------------------
Output:

off -> C1
----------------------------------------

</FALSE BRANCH>
----------------------------------------

</TRUE BRANCH>


<FALSE BRANCH>

</FALSE BRANCH>
----------------------------------------

----------------------------------------
Goto Connection PointGoto Connection Point: [A]: A
----------------------------------------

run fine on the chip unless i turn port c off individually.. thanks

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: pic 16f1788

Post by chipfryer27 »

Hi

When you save your chart you get a file with a .fcfx extension (for example, test.fcfx).

This is the file you need to attach. If you click on Full Editor & Preview you will see an option to attach the file (you may need to scroll down) or you can just drag-n-drop into the reply window.

We really do need to see the chart to help.

Regards

Post Reply