Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : (DM) PWM on GPIO?
Author | Message | ||||
Blackened Regular Member Joined: 11/08/2012 Location: AustraliaPosts: 66 |
G'day all, I need some hand-holding ;) I'm a babe-in-the-woods when it comes to microcontrollers. I bought myself one of these Duinomite Megas a couple of months ago to have a play with . I love it :) To the point then...... I'd like to keep the existing sound output for *gasp* sound output. But I also need PWM to throttle the power of an electric element. Is there a way to also have PWM on a GPIO pin? I was kinda hoping to avoid the learning curve associated with editing source code and recompiling a custom hex (forgive my newbie terminology, I think I've got that right lol). If I have to I guess I have to..... I don't suppose this will be supported in future versions? Oh yeah, during testing I found that the default output on the audio was 100% duty at switch on. To get the voltage to drop to zero I needed to use "SOUND freq,,0". Is this normal? I was expecting 0 volts until a "SOUND" command was executed. I have a rudimentary understanding of electronics. Thanks Everyone :) |
||||
donmck Guru Joined: 09/06/2011 Location: AustraliaPosts: 1313 |
Hi Peter, welcome aboard. First question. What firmware are your running? Don... https://www.dontronics.com |
||||
Blackened Regular Member Joined: 11/08/2012 Location: AustraliaPosts: 66 |
Hey Don, thanks :) Running 3.2c |
||||
donmck Guru Joined: 09/06/2011 Location: AustraliaPosts: 1313 |
OK, I am not familiar with V3.2 to that degree, so I think best you check in the manual: Geoff Graham's MaxiMite Page (for all documentation, manuals etc.) http://geoffg.net/maximite.html Unless someone in the groups knows off the top of their head. Don... https://www.dontronics.com |
||||
Blackened Regular Member Joined: 11/08/2012 Location: AustraliaPosts: 66 |
Thanks Don. It's definitely not a function available with the 3.2C firmware. I was hoping someone more knowledgeable may have already modified DM3.2c to give it this function. I'm thinking one way around it might be to use SETTICK @ 1 second intervals, and switch a pin on for the desired ms. Then take temperature readings etc... And check for key presses. A 1Hz cycle would probably be fine but I'll need to do some testing and watch the temperature fluctuation. A problem with this method though would be when I need close to 100% duty. I'm not sure how long it takes to read the temperature from a one-wire device (just forget the proper item#). I may find that the temperature wouldn't be updated very frequently, but I guess I could just go from 100% to 90% or whatever it takes to give enough time for everything else. Still waiting on parts before I can start exploring my options. Cheers Peter |
||||
Print this page |