Page 1 of 1
RGB Led.
Posted: Fri Nov 10, 2017 12:42 pm
by gdt
Hello all,
I've imported one of my old project using an RGB Led which was running fine in simulation and on chip, but in FC7 it doesn't work anymore.
Then I rebuilt it from scratch and I got the same results. Finally I downloaded the example in RGB_LED.fcfx from wikyv7 page and I cannot get it working.
Is it a buggy component or I'm missing something?
Thanks
Giuseppe
Re: RGB Led.
Posted: Fri Nov 10, 2017 8:54 pm
by Docara
Hi
Can you post your chart
Thanks
Re: RGB Led.
Posted: Fri Nov 10, 2017 9:33 pm
by gdt
Hello,
thanks for your replay.
As told it's the example from the wiky. Anyway I changed the port and played with Timer timing but no change.
Here is the link
http://www.flowcode.co.uk/wikiv7/index.p ... 10f03ce81d
and in attachment both versions (mine is v1).
Regards
Giuseppe
Re: RGB Led.
Posted: Mon Nov 13, 2017 10:58 am
by Benj
Hello,
In your chip configuration you have set the oscillator type to INTOSC, the default rate for this is 500KHz which is quite slow and could be the cause of the problems your having.
If you're using the INTOSC then I recommend you use the INTOSC helper component to help you to configure the speed of the oscillator.
For example running at 32MHz. Change the clock speed in the project options to 32000000 and then add the following code in a C code icon at the start of your project,
The 1 second LED flasher technique is great for solving problems like this.
https://www.flowcode.co.uk/wikiv7/index. ... ED_flasher
Hope this helps.
Re: RGB Led.
Posted: Mon Nov 13, 2017 12:46 pm
by gdt
Hello Ben,
thanks for your replay.
Just forget about my project. I'm asking about the example from wiky page RGB_LED.fcfx.
I haven't changed anything however it's not working for me. Can you check please if it works for you? Are you able to light the LED and get different colors just playing with the 3 pots?
If it works for you I have to troubleshoot my configuration or whatever but if doesn't...
Thanks
Giuseppe
Re: RGB Led.
Posted: Mon Nov 13, 2017 1:18 pm
by Benj
Hello,
What is your hardware setup? Are you using an EB006 with 19.6608MHz crystal and 16F1937 chip?
Can you confirm the OSC/A6&7 jumper is in the OSC position and that the jumper links are horizontal as shown in the image here,
http://www.flowcode.co.uk/webshop/e-bloc ... ion-9.html
Re: RGB Led.
Posted: Mon Nov 13, 2017 1:25 pm
by gdt
I talk about simulation on laptop. It was working and I would see it working again on simulation before to try the hardware.
Is it working the example "as is" without modification?
Re: RGB Led.
Posted: Mon Nov 13, 2017 1:33 pm
by Benj
Aha,
Ok now we are getting somewhere, Timer interrupts are currently known to have problems in simulation. It's something we tried to improve and ended up somehow making it a lot worse. If you call the timer interrupt macro as part of your main loop or run the code on a microcontroller then it should solve the problem for you.
Re: RGB Led.
Posted: Mon Nov 13, 2017 1:39 pm
by gdt
Ok, this sounds better!
Thanks
Giuseppe
Re: RGB Led.
Posted: Mon Nov 13, 2017 1:58 pm
by Docara
Benj wrote:Aha,
Timer interrupts are currently known to have problems in simulation.
Does this apply to FC generally or just the chip mentioned
Matt
Re: RGB Led.
Posted: Mon Nov 13, 2017 2:28 pm
by medelec35
Hi Matt,
Docara wrote:Does this apply to FC generally or just the chip mentioned
FC generally.
I reported it
here
It's also been mentioned
here
Martin
Re: RGB Led.
Posted: Thu Mar 01, 2018 3:42 pm
by faveremario
Hi
Is there a way to make the RGB function in simulation under FC7? On my PC the ISR is launched, but nothing changed to the RGB-color...
So I modified the demo from FC-wiki as follows :
* disable IRQ on T0
* copy the component Tick after the 100ms delay
no change in RGB-color on simulation....
Re: RGB Led.
Posted: Thu Mar 01, 2018 3:55 pm
by Benj
Hello,
The RGB LED should simulate without having to mess about, try some saturated colours such as 255 for the colour channels. Low colour values tend to appear very dark on a PC monitor.
If you can't get it working then please post your program and we will take a look.
Re: RGB Led.
Posted: Thu Mar 01, 2018 4:07 pm
by faveremario
Wow that's a quick reply
Included is a running screenshot of the simulation and also the program.
The color of the LED does not change (in neither of the programs).
First is from WIKI
V2 is modified : not using the IRQ from T0
Thanks.
Re: RGB Led.
Posted: Thu Mar 01, 2018 5:20 pm
by Benj
Many thanks for letting us know.
I have now found and fixed the problem in the attached component file.
Simply copy to your "Flowcode 7/components" folder and restart Flowcode to load the changes.
Let us know how you get on.
Re: RGB Led.
Posted: Thu Mar 01, 2018 8:48 pm
by jgu1
Hi All!
The new component work for me in simulation now
And thank¨s for info to Ben and medelec concerning waitingtime in simulation-
Br Jorgen
Re: RGB Led.
Posted: Thu Mar 01, 2018 10:34 pm
by gdt
Hello faveremario,
thanks to convince Benj to fix this component as I asked looooooooong time ago!
Now simulation is fine for me too.
Regards
Giuseppe