PSoc 4200M unexpected behaviour

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Please can somebody on this list enlighten me on the following problem:

   

New to the PSoC devices I am trying to understand how they work.

   

Made a simple program (software) to blink two LEDS where one LED is on the other is off.

   

This worked as I aspect.

   

Then I wanted to do the same in hardware (no programming involved)

   

Put two dividers in serial, connected one LED directly  on the output of the second divider.

   

In front of the other LED I put an NOT gate and connected the input of the NOT gate also

   

with the output of the second divider.

   

Expected behavior: One LED on the other LED off and vice versa.

   

But both LEDS  blink at the same time (LED 1 on = LED 2 on etc.)

   

See schematic attached,

   

 

   

Thanks in advance for any entlightment,

   

Giel Peters

0 Likes
8 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

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.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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.

   

Kind regards,

   

Giel Peters

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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??

   

 

   

Bob

0 Likes
Anonymous
Not applicable

@ 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,

   

Regards,

   

Giel Peters

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

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.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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%     ,-)

   

 

   

Bob

0 Likes
Anonymous
Not applicable

"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"...)

0 Likes