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
Loop problems?
Moderator: Benj
- 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?
Hello.
I think what is most likely the case is you do:
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.
If this is not the issue, please post your flowchart and we can have a look.
Cheers,
Jonny
I think what is most likely the case is you do:
Code: Select all
loop
led_on
delay
led_off
end_loop
Code: Select all
loop
led_on
delay
led_off
delay
end_loop
Cheers,
Jonny
-
- Posts: 28
- Joined: Wed Apr 04, 2012 1:33 pm
- Has thanked: 3 times
- Been thanked: 3 times
- Contact:
Re: Loop problems?
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
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
- 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?
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.
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.
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
-
- Posts: 28
- Joined: Wed Apr 04, 2012 1:33 pm
- Has thanked: 3 times
- Been thanked: 3 times
- Contact:
Re: Loop problems?
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
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