4 Replies Latest reply on Jun 2, 2014 9:37 AM by fabien.colas

    HOW TO SEND WORD USING PWM.

    pramod.sherkar

      Hi to all

         

      Does any one help me or guide me for sending word or byte using PWM.

         

      Regards.

        • 1. Re: HOW TO SEND WORD USING PWM.
          user_1377889

          PWM is usually found in controlling applications, not for the transmission of information. When I understand your question correctly you want to "send a word or byte" this might be difficult to regain the sent information correctly.

             

          A PWM has 2 parameters to controll it:

             

          The period that describes how often (at which frequency) the information gets repeated

             

          and the duty-cycle which actually contains the information to be sent.

             

          Realization of PWM in PSoCs is made with a counter fed by a clock and a comparator that compares for "less than the counter". Since the maximum of the compare-value is the period, the precision of the PWM gets better with increasing width of the counter, usually selectable between 8 and 16, sometimes up to 32 Bits.

             

           

             

          Bob

          • 2. Re: HOW TO SEND WORD USING PWM.
            user_14586677

            If you are trying to convert a byte into a PWM signal, say dusty cycle, then

               

            decode it at other end and retrieve initial byte value, you would do so by

               

            controlling PW on send side, then measuring the PW on the receive side.

               

            But you have errors associated with measuring period and PW, +/- 1 count

               

            issues with gating, clock differences......

               

             

               

            This is best done via UART, I2C, SPI, One Wire....a serial protocol. Then you will

               

            elimnate some of the aforementioned issues.

               

             

               

            Regards, Dana.

            • 3. Re: HOW TO SEND WORD USING PWM.
              ki.leung

              While it is not common. You can use pulse with mark/space ratio of 75/25 for a 1 and 25/75 for a 0 or vice versa. And some uses 2 pulse width ie a 10ms high pulse is a 0 and a 20ms pulse as a 1. But unless you need to interface an existng device with that requirment. There are better ways to send serial data as suggested by Bod and Dana.

              • 4. Re: HOW TO SEND WORD USING PWM.
                fabien.colas

                PWM isn't usually used to transmit serial information, but you can write your own low-level protocol... It would be easier to use, as dana said, standard serial protocols.