Loop problems?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Rabbit
Posts: 28
Joined: Wed Apr 04, 2012 1:33 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Loop problems?

Post by Rabbit »

Hello,
I wrote a little Programm (FC5) for switching LEDs on/off.
The delay between on/off is 1 second. A loop while was inserted after "start" and before "end".
The simulation is running well. Compiler message is ok.
My problem: the real LEDs are continous on.
It seems the loop will be ignored at the PIC 16F88.

What may be wrong?

Thank you very much in advance.
Rabbit

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Loop problems?

Post by JonnyW »

Hello.

I think what is most likely the case is you do:

Code: Select all

  loop
    led_on
    delay
    led_off
  end_loop
In this case there is a delay before 'off' but not one before 'on' - on HW this will appear to be continuously on. Add a second delay after 'led_off' to sort this. Like below.

Code: Select all

  loop
    led_on
    delay
    led_off
    delay
  end_loop
If this is not the issue, please post your flowchart and we can have a look.

Cheers,

Jonny

Rabbit
Posts: 28
Joined: Wed Apr 04, 2012 1:33 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: Loop problems?

Post by Rabbit »

Hello Jonny,
Thanks for your answer. I have two "wait" in my little programm.

How can I post my flowchart here in the forum?

Now I changes the delay-time from 1 second to 1 millisecond and the LEDs are flashing with about 1 Hz.
So I think there is a little bug at the compiler.
I use flowcode V5.1.0.0 (10.02.2012)

Best regards
Rabitt

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: Loop problems?

Post by Benj »

Hello,

My guess is that your settings in Flowcode are not set up correctly for your hardware. Please check the clock speed specified in the project options window and also check the configuration settings are correct for your hardware setup.

Rabbit
Posts: 28
Joined: Wed Apr 04, 2012 1:33 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: Loop problems?

Post by Rabbit »

Hello,
I've found my bug: the missing OUT-channel RB3 was used as ICSP-programming-pin in the project options.
I disabled low-voltage-programming and all output-pins at Port-B are available.

Regards Rabbit

Post Reply