- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Today one of my colleagues encountered an interesting phenomenon.
He was using a CY8CKIT-149.
He connected an output of a PWM to an output pin LED13 (P5[5]) and to data7 of SmartIO.
The SmartIO was configured just like a jumper wire (1->1, 0->0) and its gpio6 was connected to LE8 (P1[6]).
When both PWM and SmartIO were Start()ed, both LEDs were blinking together.
But when PWM_Stop() was called, LED8 was ON but LED13 was OFF.
We were expecting that both LEDs should behave similarly as their logic come from the same line_n of PWM.
Since LED8 was ON, we assumed that the line connected to data7 of SmartIO is LOW,
then LED13 which is connected to the same line should be LOW, too.
And if it is so, LED13 should be ON.
[ QUESTION! ] Could someone teach us why this is happening?
To reproduce the phenomenon, I made following simplified project.
Schematic
Pin Assignment
SmartIO Configuration
LUT 6
PWM Config
main.c
=================
#include "project.h"
/**
* LED8 is connected to SmartIO
* LED13 is conncted to PWM line_n
*/
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
SmartIO_Start() ; // (A) LED8 is ON and LED13 is OFF
PWM_Start() ; // (B) both LED8 and LED13 blink synchronizedly
CyDelay(3000) ; // (C) let LEDs blink for 3 seconds
PWM_Stop() ; // (D) LED8 is ON and LED13 is OFF
SmartIO_Stop() ; // (E) both LED8 and LED13 is OFF
for(;;)
{
// rest is silence
}
}
=================
moto
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tanaka-san,
Thank you for your update on the topic.
We welcome any study and research on Cypress product application which is a key to help us move on continually.
Regarding the phenomenon, output PIN (port) of PWM is high-Z(as per HSIOM configuration) so that PWM output LED turns off.
Yes. I think so. SmartIO treats disabled signal ("line" of PWM) as LOW (When I change LUT6 logic to 0 0 0->1, 1 1 1->). After PWM_Stop(), SmartIO output will be high, and SmartIO LED turned off.
Best Regards,
Ryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oops, I was trying to replace the schematic, but accidentally saved the topic.
Following is the schematic
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tanaka-san,
I guess there may be something with drive mode of these two pins or the internal connection issue.
I saw drive mode of these two pins are both strong drive.
So this could be caused by internal connection of these two pins after PWM stop are different. I will double-check the code and internal connection.
Meanwhile, we can test if both line output and line_n output has same phenomenon.
Best Regards,
Ryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Ryan-san,
Thank you very much for your response!
Since I'm out of my office, I can not test it today,
but I'd like to test line and line_n tomorrow.
And, Yes, I'm looking forward to hearing update(s) from you.
Best Regards,
9-Oct-2019
Motoo Tanaka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Ryan-san,
I tested with line.
And again LEDs did not agree when PWM is stopped.
PWM config
Although PWM config, IMHO, suggests that line is LOW when not active,
the PWM's line output connected to the external pin (P5[6]) behave otherwise,
meantime SmartIO shows that data6, which is also connected to PWM's line output shows it is LOW.
We have some suspect that when an internal component is stopped the IOB connected to that component
takes its "initial value" instead of the supposed logical value of the internal component.
In this case, LED13's Initial drive state is High(1), although we can not control it.
This assumption also agrees with the behavior of LED8, which is ON after PWM was stopped,
but when SmartIO is stopped, LED8 also gets OFF.
schematic
pin assign
SmartIO config
LUT7 config
main.c
=====================
#include "project.h"
/**
* LED8 is connected to SmartIO
* LED13 is conncted to PWM line
*/
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
SmartIO_Start() ; // (A) LED8 is ON and LED13 is OFF
PWM_Start() ; // (B) both LED8 and LED13 blink synchronizedly
CyDelay(3000) ; // (C) let LEDs blink for 3 seconds
PWM_Stop() ; // (D) LED8 is ON and LED13 is OFF
SmartIO_Stop() ; // (E) both LED8 and LED13 is OFF
for(;;)
{
// rest is silence
}
}
=====================
Best Regards,
10-Oct-2019
Motoo Tanaka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tanaka-san,
PWM_Stop() ; only stopped output of PWM component,
but the output buffer of SMARTIO is not disabled. SmartIO_Stop() ; will disable SMARTIO Component output buffer so that output of SmarIO will be stopped.
Best Regards,
Ryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Ryan-san,
Thank you very much for your answer.
Would you teach us below?
> PWM_Stop() ; only stopped output of PWM component,
> but the output buffer of SMARTIO is not disabled.
What is the "output" of PWM?
Is it the output port connected to the external pin
or the "line" signal of PWM component?
From the symptom I think that the output PIN (port) of PWM
is either high or high-Z so that LED turns off.
But as LED connected to the SmartIO is on,
which means the signal "line" of PWM is LOW
or SmartIO treats disabled signal ("line" of PWM) as LOW,
so that the LED turns on.
I'm sorry for being picky, but we also having been wondering about this.
Best Regards,
28-Oct-2019
Motoo Tanaka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tanaka-san,
Thank you for your update on the topic.
We welcome any study and research on Cypress product application which is a key to help us move on continually.
Regarding the phenomenon, output PIN (port) of PWM is high-Z(as per HSIOM configuration) so that PWM output LED turns off.
Yes. I think so. SmartIO treats disabled signal ("line" of PWM) as LOW (When I change LUT6 logic to 0 0 0->1, 1 1 1->). After PWM_Stop(), SmartIO output will be high, and SmartIO LED turned off.
Best Regards,
Ryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Ryan-san,
Thank you very much for your answer!
Best Regards,
31-Oct-2019
Motoo Tanaka