Welcome in the forum, Giel!
Best to check your project is to provide us with *ALL* informations. Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
A hint on which board you use (self-made? Development/Prototyping Kit? Which one??) can help us furthermore.
Its interesting that this project compiles - I thought that all inputs of the dividers need to be connected (EN=high, Reset=low). Otherwise I can see no direct reason why this would occur.
I would first check the wiring to see if its really as in the schematic (maybe you can share a photo?) (Btw: 10k seems quite high, that's less than 0.5mA LED current).
(Also, its more effective to use a counter or a PWM component since it uses less resources than two dividers with such a high factor)
A debugging hint: you can names to the nets (right-click, 'set name and width'). After a compile, you can open the *.rpt file which has the routing information, and the configuration of the UDBs / macro cells in it. I did this with a project done after your image, and it indeed says led2=!led1, so the NOT gate is clearly in there.
I am using the kit: CY8CKIT-043 with the PSoC 4200M CY8C4247AZI-M485
I attached the projects workspace bundle (the name is misleading as I tried to implement this with a PWM module at first)
And yes 10k is a bit high but being in a learning fase (and some bad experiences) I am very fond keeping my board (chip) working.
PWM_Test.cywrk_.Archive02.zip 417.4 K
I just ran your project on my -044 Kit and all was well.
Where do you get the second LED from? there is only one user LED on the board??
@ user_2273 You where right, checking the hardware (the schematic from the board) revealed that the led is connected with the cathode at Ground. I presumed (hearing the echo of one of my teachers: Never presume! Always check and check once more!) that the LED on board was connected with the cathode at 5V. My own LED was connected with the cathode on 5V. So the line up was correct. When I removed the NOT-gate in the line to "my own" LED everything works as aspected!
I tried to accomplish this with a PWM but until now to no avail. I shall examine some examples to see what I do wrong.
Thanks for the comment and both of your time,
When I look back at all the errors in my projects, probably 90% of them where when I made assumptions and did not check the for correctness...
For the PWM: just create a PWM component, feed it with your 12KHz clock, set the period to 12000 and the compare value to 6000. This should give you a 1Hz signal with 50% duty cycle.
When you have the choice between two wires to select the right one, the probability for a failure is 50%. But I can assure you that these 50% are used up to at least 100% ,-)
"Just" creating a PMW and act like you said is not enough. Because that is what I started with, to no avail. But examining the datasheet from the PWM revealed that you have to start it... (PWM_Start();) so adding this line of code to the main.c did the trick. Nice example of "looking further then a nose length" (I don't no if this is a correct translation of the Dutch saying: "verder kijken dan je neus lang is"...)