I need help to use the PWM feature to generate 32 bits pulses, the pulse are generate by reading the a potentiometer from RA0,
all these 32 pulses are like this:
16 high pulse (40usec)-these pulses are use as a markers between data bits (always 40usec pluse)
16 low pulse (either 40usec or 80usec)-these pulse are represent valid data example =40usec is a 0, 80usec is a 1, the data will change according to the the RA0 port.
If you tell us what device you're trying to control, then we can probably
help you more easily. Tell us the manufacturer and the part number.
Provide a link to the website.
When you do ASCII art, put it in a Code block. Then click the Preview
button to see what it will look like when it's posted. Make any required
changes and Preview it again until it looks correct.
Steve H Guest
Posted: Sun Jun 03, 2007 7:37 am
I think you might be able to control the PWM enough to change the PWM value on the fly between every pulse - but I think a simpler approach might be to bit bang the data out.
Have a loop that goes through the bits one at a time (shift left or shift right).
Put out the marker - 16 uS
Put out the 40 or 80 uS pulse base on a one or zero of the shifted data
Loop again
There is an app note on the Microchip website about generating high resolution PWM pulses which you might want to take a look at for the PWM solution.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum