- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi to all
Does any one help me or guide me for sending word or byte using PWM.
Regards.
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.