cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor II

Hi everyone, I have been working with psoc for a while (5 years), and with psoc 1 I changed once a PWM output through software dinamically, I mean, in the block diagram I set the output to a certain pin and then in the code I changed it to another pin when I needed it. But rigth now I am working with a Psoc 4 kit wich has the CY8C4125AXI483 and I cannot find how to do the same thing with this psoc, I have read the GPIO manuals and the TRM and I cannot find it. It is possible to do it??? Thanks in advace.

Ale

0 Likes
Reply
1 Solution
Esteemed Contributor

Hi,

I tried following schematics

Rev.2 using output enable

rev2.JPG

This seemed to be almost OK, but time to time I observed following symptom

IMG_3470.JPG

Rev.3 using AND gates

rev3.JPG

The wave form was as clear as the MUX version.

So I suppose using AND and Control_Reg seems to be a recommended method, so far.

moto

View solution in original post

4 Replies
Esteemed Contributor

Hi,

I tried this with CY8CKIT-044.

schematic

000-schematic.JPG

pin

001-044-pin.JPG

main.c

====================

#include "project.h"

int main(void)

{

    int i = 0 ;

    CyGlobalIntEnable; /* Enable global interrupts. */

    PWM_Start() ;

    for(;;) {

        Control_Reg_Write(i) ;

        i = (i + 1) % 3 ; /* 0, 1, 2, 0, ... */

        CyDelay(10) ;

    }

}

====================

the oscilloscope screen

IMG_3464.JPG

attached is the test project.

moto

New Contributor II

Thanks I thought in that too, but I have read in the multiplexer (MUX) datasheet that it makes certain delay (microseconds) for the signals passing through it and for my application that is not an option. Don't you have any other idea. The pulse I want to generate is a 100 kHz pulse but with a Ton=50ns, that is why the MUX is not an option. Thank you!!!!

0 Likes
Reply
Esteemed Contributor

Hi,

I tried following schematics

Rev.2 using output enable

rev2.JPG

This seemed to be almost OK, but time to time I observed following symptom

IMG_3470.JPG

Rev.3 using AND gates

rev3.JPG

The wave form was as clear as the MUX version.

So I suppose using AND and Control_Reg seems to be a recommended method, so far.

moto

View solution in original post

New Contributor II

Thanks moto, I will try tomorrow and let you know how it went!!! Thanks!!!!

0 Likes
Reply