Quote:
Originally Posted by Generalx5
Anyone know a simple decoder I can easilly make on a PCB board? Eds link has something thats too complicated. I just need a basic RC PWM to Standard PWM converter, a small pakage would be nice.
|
I was playing with this about a year and a half ago. I made a speed controller based on an L298 and 12F683 (one of the 8 pin PICs). The PIC is essentially being used as an RC PWM to traditional PWM converter (two outputs to control an H-bridge). It works, but it has some software bugs. (the only one I can recall off the top of my head is that if it loses the input signal, it defaults to full speed forward)
The basics of what it does:
1. When you get the rising edge of the pulse, start a timer.
2. Stop the timer on the falling edge.
3. Do some checks to make sure that it's a valid signal.
4. If it's 1.5ms, set outputs to 0. If it's >1.5ms, calculate the appropriate duty cycle and set outputs for forward. If <1.5ms, calculate appropriate duty cycle and set outputs for reverse.
5. Wait for next pulse.
I've attached the code for it. I have to warn you though, the bugs aren't documented and the comments aren't the clearest or most complete. Depending on what you're trying to do, you may or may not want to fix the bugs. Actually, you know what? I would advise that you don't actually use it. Instead, you could use it as a reference if you decide that you want to make your own converter. It's been so long that I don't even remember what all the code does. If you're just looking for a toy though, you should be able to just load the code into an appropriate PIC and plug it all in.