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.
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.
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)
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 ?
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).
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.