Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Stavros Korokithakis
@skorokithakis
that's surprising, though
Chris Elsworth
@celsworth
all I'm doing atm is analogWriteFreq(50000); analogWrite(2, 512); then watching the result :)
Stavros Korokithakis
@skorokithakis
makes sense
Chris Elsworth
@celsworth
at 20000 its very stable, even though its sending 22kHz according to the scope hardware counter O_o
Stavros Korokithakis
@skorokithakis
that's very odd
are you sure you didn't just mistype 22000? :P
Chris Elsworth
@celsworth
very sure :)
I'll try it at 22000 actually :)
Stavros Korokithakis
@skorokithakis
huh, weird
yeah, see what that says
Chris Elsworth
@celsworth
that says 22.2kHz, how strange
Stavros Korokithakis
@skorokithakis
hm
why are you analogWrite()ing 512?
Chris Elsworth
@celsworth
to get a 50% duty cycle, just to make it easier to see on the scope
Stavros Korokithakis
@skorokithakis
isn't it 0-255?
Chris Elsworth
@celsworth
0-1023 according ot docs
Stavros Korokithakis
@skorokithakis
ah, different from the arduino
Chris Elsworth
@celsworth
it is working, I have a nice square wave displayed, jjsut the frequency isnt' all that accurate, especially at higher PWMs
1000 is pretty much bang on.. 996Hz
Stavros Korokithakis
@skorokithakis
maybe this is related? esp8266/Arduino#836
odd how the frequency is sometimes higher and sometimes lower
Chris Elsworth
@celsworth
you might be able to see it on logic analyzer too
going down to 200Hz..
Stavros Korokithakis
@skorokithakis
i'll give it a shot when i set it up, i have things set up differently now :/
Chris Elsworth
@celsworth
199.7Hz, thats getting quite good now. I think its probably just interrupt limitations
could try bitbanging but can't keep that up for long or the chip will jsut reset :/
Stavros Korokithakis
@skorokithakis
how long do you want to do it for?
Chris Elsworth
@celsworth
basically permanently, I need a permanent output voltage at a level of my choosing
Stavros Korokithakis
@skorokithakis
ah hm
Chris Elsworth
@celsworth
I have a motorised ball valve on order, and it takes a control input voltage of 0-10V to decide how "open" it is
I can op-amp up to 10V, thats no problem
Stavros Korokithakis
@skorokithakis
hmm, right
Chris Elsworth
@celsworth
its just generating a signal in the first place, I was going to PWM and then low-pass filter
Stavros Korokithakis
@skorokithakis
yeah
Chris Elsworth
@celsworth
1kHz will probably do, I need to do the maths to see how much ripple it will generate
Stavros Korokithakis
@skorokithakis
if the frequency is too high, i think the pwm wouldn't be able to keep the watchdog happy
that's probably why it's not going as high as bitbanging
Chris Elsworth
@celsworth
but since its driving a motor I don't want much ripple, or the motor will permanently be trying to move, not good
Stavros Korokithakis
@skorokithakis
yeah :/
Chris Elsworth
@celsworth
apologies @all for offtopic :)
kinda gone into electronics ;)
Stavros Korokithakis
@skorokithakis
ouch, that notification to 219 people isn't going to be popular :P
Chris Elsworth
@celsworth
oops, does that really do that
Stavros Korokithakis
@skorokithakis
i'm not 100% sure, it does on slack
i assume it notifies people somehow here too
Chris Elsworth
@celsworth
hmm apparently "ALL" is actually a github user, hover over it :)
oh well, maybe he'll come to arduino ;)
Stavros Korokithakis
@skorokithakis
oh haha
Chris Elsworth
@celsworth
did you do direct register manipulation for your bitbanging? I've seen that done, need to look it up, I think digitalWrite() won't get near 1MHz :)
Stavros Korokithakis
@skorokithakis
i just did digitalWrite