About PWM component for PSoC4000S

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

cross mob
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

I have a question.

When I use PWM component to output on GPIO if I execute "PWM_Init()" and have waiting time before "PWM_Enable()", GPIO seems to be Hi-Z at that time .

pastedImage_1.png

Similaly, when I use PWM component to output on GPIO from SmartIO if I execute "PWM_Init()" and not execute "PWM_Enable()", is Pin_PWM output unstable or does it occur latch-up?

pastedImage_2.png

Best regards,

Yocchi

0 Likes
1 Solution

If you want to stop the PWM counter, please use following instead of PWM_Stop();

PWM_TriggerCommand(PWM_MASK, PWM_CMD_STOP);

PWM_Stop() releases all allocated resource including the output pin.

Regards,

Noriaki

View solution in original post

0 Likes
19 Replies
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

I have a mistake in SmartIO.

I correct it.

pastedImage_1.png

Best regards,

Yocchi

0 Likes

Hi YoIs_1298666​,

The GPIO pin setting will be done on the configurator in the top design which will be set to strong drive.

Whatever peripherals you add to the component the drive mode will not be changed unless and until you go and call a particular function to change the mode i.e. Pin_SetDriveMode function can be used to change the mode.

Regards

Alakananda

Alakananda
0 Likes

Hello Alakananda-san,

The former(PWM component only) is selected "Strong drive". but if only "PWM_Init()" is done, or "PWM_Stop()" after "PWM_Start()" is done, Pin_PWM seems to be Hi-Z. In that case, the extenal pull-up resistor is need, right?

Under the same situation, is the data6 input of SmartIO in the latter(PWM + SmartIO component)

stable or unstable?

Best regards,

Ishii

0 Likes

Hi YoIs_1298666​,

The former(PWM component only) when selected  as "Strong drive" will not change if "PWM_Init()"  or "PWM_Stop()" or"PWM_Start()" is done, and that will not affect the Pin_Pwm when any peripherals are connected also. You can go and read the register which you have configured and you will find it will still be in strong drive mode only irrespective of what you have given.

The latter PWM component with smart IO which you have used i.e the connection from the Pwm line to the data6 will be internal to the device and it will be stable.

Regards

Alakananda

Alakananda
0 Likes
lock attach
Attachments are accessible only for community members.

Hello Alakananda-san,

I attached the easy PWM project for CY8CKIT-145-40XX.

If SW2 is not pushed, the PWM starts and outputs the pulse(0V to 5V).

If SW2 is continued to push, the Pin_PWM outputs halfway 3.3V.

If you touched the Pin_PWM with your finger, it will storm like Hi-Z state.

What's happning?

Best regards,

Yocchi

0 Likes

Hi YoIs_1298666​,

We are also observing the same phenomenon as you have observed with your project but we are not understanding what you mean by when we touch the Pin_Pwm pin with finger it will storm like HI-Z state can you please show how you are seeing that it is going to HI-Z state.

Regards

Alakananda

Alakananda
0 Likes

If you want to stop the PWM counter, please use following instead of PWM_Stop();

PWM_TriggerCommand(PWM_MASK, PWM_CMD_STOP);

PWM_Stop() releases all allocated resource including the output pin.

Regards,

Noriaki

0 Likes

Hello, Noriaki-san,

I have already confirmed that the "PWM_TriggerCommand(PWM_MASk, PWM_CMD_STOP" has no probleem.

Best regards,

Yocchi

0 Likes

Hello Alakananda-san,

A slight touch with a finger generates an inductive potential between the human body and earth, which amplifies noise. The impedance is high where the output waveform is greatly disturbed.

Best regards,

Yocchi

0 Likes

Hi YoIs_1298666

Can you please share the waveforms which you got when you touch the Pin_Pwm.

Regards

Alakananda

Alakananda
0 Likes

Hello Alakananda-san,

Please see below.

  Running PWM waveform after PWM_Start()

pastedImage_0.png

  Stopping after PWM_Stop() without finger touch                 Stopping after PWM_Stop() with finger touch

pastedImage_0.png             pastedImage_1.png

Best regards,

Yocchi

0 Likes

Hi YoIs_1298666

When we tried your project we are not getting any noise on touch and the waveform remains the same.

Can I please know why are you touching the pin_pwm?

Regards

Alakananda

Alakananda
0 Likes

Hello Alakananda-san,

Lead-free solder has an oxidized surface and does not change even when touched with a finger. Hold the needle with your finger and touch the solder area with the tip of the needle.

Best regards,

Yocchi

0 Likes

Hi YoIs_1298666​,

Actually we are not supposed to touch the output pins and we tried whatever you suggested but its not changing for us.

Regards

Alakananda

Alakananda
0 Likes

Hello Alakananda-san,

This situation of GPIO pin is same as during RESET state.

Even if "Initial drive state" is "High(1)" or "Low(0)", the halfway voltage is output.

If external 5k ohm pull-up resistor is inserted, the output is "High(1)".

But if external 5k ohm pull-down resistor  is inserted, the output is kept the halfway voltage.

Best regards,

Yocchi

0 Likes

Hello, Alakananda-san,

I made a mistake.

I selected P3_5 for the PWM output. The P3_5 is connected to LED10 of CY8CKIT-145-40XX.

So, if we touch this pin, the signal is not under 3.3V.

I reselected P2_7 that is not connected to anywhere. I cold confirm Hi-Z.

In conclusion, if the PWM output is selected to PWM_stop() after PWM_start() or PWM_init()

it is kept in high impedance even if it is selected "Resistive pull up" or "Resistive pull down " instead of "Strong drive".

Requires an external pull-up resistor.

or it should be executed API "PWM_TriggerCommand(PWM_MASK, PWM_CMD_STOP) ".

Best regards,

Ishii

0 Likes
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi YoIs_1298666​,

We think the issue you are facing is because of the input buffer so go and turn off the input buffer.

Regards

Alakananda

Alakananda
0 Likes

Hello, Alakananda-san,

I don't know what you mean.

I am configuring like below.

Best regards,

Yocchi

0 Likes

Hi YoIs_1298666​,

Sorry for not making my statement clear.

You have to go and write 1 in the register which I have shared below and disable the input buffer due to which you might be experiencing noise so please try doing this and let us know.

Capture1.PNG

Capture.PNG

Since you are using pin 2_7 you have to go and write 1 in the place of INP_DIS7 and the input buffer will be disabled.

Regards

Alakananda

Alakananda
0 Likes