RGB Led.
Moderator: Benj
-
- Posts: 71
- Joined: Thu Aug 10, 2017 2:04 pm
- Has thanked: 25 times
- Been thanked: 36 times
- Contact:
RGB Led.
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
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
-
- Posts: 71
- Joined: Thu Aug 10, 2017 2:04 pm
- Has thanked: 25 times
- Been thanked: 36 times
- Contact:
Re: RGB Led.
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.matrixtsl.com/wikiv7/index.p ... 10f03ce81d
and in attachment both versions (mine is v1).
Regards
Giuseppe
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.matrixtsl.com/wikiv7/index.p ... 10f03ce81d
and in attachment both versions (mine is v1).
Regards
Giuseppe
- Attachments
-
- RGB_LED_v1.fcfx
- (12.94 KiB) Downloaded 275 times
-
- RGB_LED.fcfx
- (9.21 KiB) Downloaded 258 times
- 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: RGB Led.
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.matrixtsl.com/wikiv7/index. ... ED_flasher
Hope this helps.
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,
Code: Select all
OSCCON = 0xF0;
https://www.matrixtsl.com/wikiv7/index. ... ED_flasher
Hope this helps.
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: 71
- Joined: Thu Aug 10, 2017 2:04 pm
- Has thanked: 25 times
- Been thanked: 36 times
- Contact:
Re: RGB Led.
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
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
- 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: RGB Led.
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.matrixtsl.com/webshop/e-bloc ... ion-9.html
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.matrixtsl.com/webshop/e-bloc ... ion-9.html
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: 71
- Joined: Thu Aug 10, 2017 2:04 pm
- Has thanked: 25 times
- Been thanked: 36 times
- Contact:
Re: RGB Led.
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?
Is it working the example "as is" without modification?
- 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: RGB Led.
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.
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.
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: 315
- Joined: Sun Jun 23, 2013 1:29 pm
- Has thanked: 28 times
- Been thanked: 61 times
- Contact:
Re: RGB Led.
Does this apply to FC generally or just the chip mentionedBenj wrote:Aha,
Timer interrupts are currently known to have problems in simulation.
Matt
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: RGB Led.
Hi Matt,
I reported it here
It's also been mentioned here
Martin
FC generally.Docara wrote:Does this apply to FC generally or just the chip mentioned
I reported it here
It's also been mentioned here
Martin
Martin
- faveremario
- Posts: 28
- Joined: Sat Jun 02, 2012 6:08 pm
- Has thanked: 8 times
- Been thanked: 13 times
- Contact:
Re: RGB Led.
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....
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....
- 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: RGB Led.
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.
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.
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
- faveremario
- Posts: 28
- Joined: Sat Jun 02, 2012 6:08 pm
- Has thanked: 8 times
- Been thanked: 13 times
- Contact:
Re: RGB Led.
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.
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.
- Attachments
-
- RGB_LED-V2.fcfx
- (11.9 KiB) Downloaded 142 times
-
- RGB_LED.fcfx
- (13.11 KiB) Downloaded 131 times
-
- Knipsel.PNG
- (2.72 KiB) Downloaded 3659 times
- 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: RGB Led.
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.
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.
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: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: RGB Led.
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
The new component work for me in simulation now
And thank¨s for info to Ben and medelec concerning waitingtime in simulation-
Br Jorgen
-
- Posts: 71
- Joined: Thu Aug 10, 2017 2:04 pm
- Has thanked: 25 times
- Been thanked: 36 times
- Contact:
Re: RGB Led.
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
thanks to convince Benj to fix this component as I asked looooooooong time ago!
Now simulation is fine for me too.
Regards
Giuseppe