cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

Hi, 

   

I want to change the duty cycle of manchester encoded data(8 bits using SPIM). I am giving this data to clock the PWM component. But not getting the correct output. 

   

Please share some ideas to acheive this. 

   

Thanks

0 Likes
Reply
7 Replies
JoMe_264151
Expert II

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.



Bob
 

0 Likes
Reply
Anonymous
Not applicable

 Hi Bob,

   

here i attached my project. actually i want to change the duty cycle of my manchester data, so i thought of using two ways,either modulating the clock or modulating the manchester data itself. But i am not getting in any ways.

0 Likes
Reply
ETRO_SSN583
Esteemed Contributor

If you are clocking the PWM component with the data the output

   

of the PWM will have fixed bit duty cycle, clocked on the + edge

   

of the data into the PWM clock pin, but can be set with the

   

API void PWM_WriteCompare(uint8/16 compare)

   

Regards, Dana.

0 Likes
Reply
ETRO_SSN583
Esteemed Contributor

With each bit of data you trigger the PWM, but then only clock it

   

1 clock later after trigger, but then trigger again, so you are aborting

   

the PWM cycle effectively.

   

 

   

For each bit of manchester data what do you want to come out of PWM ?

   

 

   

Regards, Dana.

0 Likes
Reply
Anonymous
Not applicable

 Thanks for the response Dana,

   

I want PWM to follow the Manchester output, with capability of controlling the duty cycle (i.e. to misalign mid bit transition of manchester data).

0 Likes
Reply
ETRO_SSN583
Esteemed Contributor

Then you need a method to resample (oversample) the manchester data bit.

   

 

   

I am not exactly sure how to do this.

   

 

   

Since you are clocking at 1 Mbps I am not sure there is enough time oversampled

   

to operate on data, unless a SR used. Using a SR with one bit's "cycle" in the SR

   

you could control the load and the duty cycle. For example if oversampled by 10

   

then you could control an edge position in increments of 10%.

   

 

   

Maybe someone else has a better suggestion here.

   

 

   

Regards, Dana.

0 Likes
Reply
JoMe_264151
Expert II

You may run the PWM with two outputs with different duty cycles and select one of the outputs with the manchester signal.

   

 

   

Bob

0 Likes
Reply