Using PWM or psuedo PWM on SX28, all pins
I built a board for a friend a few years back with an SX28, so that each output controls a transistor switching on and off LEDs, using simple on>pause>off>pause for each output.
He asked me how it could be done that any or all pins could actually fade the LEDs on for his product. I don't know the chip at all, and can't think of a solution.
Is there any way to do such a thing where any or all pins can emulate or use PWM so that the On time increments towards full on?
Post Edited (TChapman) : 6/1/2009 8:36:25 PM GMT
He asked me how it could be done that any or all pins could actually fade the LEDs on for his product. I don't know the chip at all, and can't think of a solution.
Is there any way to do such a thing where any or all pins can emulate or use PWM so that the On time increments towards full on?
Post Edited (TChapman) : 6/1/2009 8:36:25 PM GMT
Comments
[noparse][[/noparse]Edit] Updated for 4MHz internal osc.
Post Edited (JonnyMac) : 6/1/2009 10:33:32 PM GMT
Oh, using internal osc, would I just change the speed and it still works ok?
Try Jonny's program using the SX-Key to generate the clock at 20 MHz. Verify it's working for you. Then, try changing the clock speed (the SX-Key can change output a wide range of clock freqs) and see if it works or not. If it's not working, try and figure out why it's not working. In other words, do some experimenting, have some fun, and learn something new in the process.
If there are problems trying to get it to work at lower freqs (such as 4 MHz), post a question explaining what you did, the results you got, and see who can help. I think you'll find you learn a lot more by trying some experiments first and asking questions when you get stuck.
Thanks,
PeterM
[noparse][[/noparse]Edit] Whoops... I should check to see if others have answered before posting, especially when posting fixes.
Post Edited (JonnyMac) : 6/1/2009 10:35:48 PM GMT
Bummer. Now you know nothing more than you did before. Oh well, perhaps next time you'll dig in and try some experimenting first. I guarantee you'll be more knowledgeable for the effort.
This is an old saying, but it's quite true:
“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime”
Thanks,
PeterM
PJ, not to be disrespectful at all, as you are clearly an asset to the forums, but you have to understand that I don't want to understand the SX, I am extremely busy with much bigger things things that learning a chip I'll never use, so the idea of me getting anything from it is a non issue. Quite honestly, I already was prepared to pay the code to get written for the guy, if it was capable of the task. Nowhere in my post does it suggest that anyone here write the code or show an example of it. It was a question of whether it was possible. So I find the lecture a bit over the top.
For that matter, should Johhny want to be compensated for his efforts within reason, I'll get that handled as well no problem
Post Edited (TChapman) : 6/1/2009 11:49:21 PM GMT
I know you're an extremely busy person with much bigger things to do, so I'll keep it short. I promise to never go over the top and try to help you be a more knowledgeable person again. Mea culpa.
Thanks,
PeterM