How to change Duty Cycle of a data?

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

cross mob
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
7 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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
lock attach
Attachments are accessible only for community members.
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
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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
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
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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