Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
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
Chris Elsworth
@celsworth
oh ok
Stavros Korokithakis
@skorokithakis
i only tried a 26ns cycle, though
i just know that the cpu latency was 1 ns
well, the processing latency in general
Chris Elsworth
@celsworth
well, I got an approx 560kHz PWM out of the esp by bit-banging, but as we said, its really not sustainable ;)
can't do it for long or the wdt will get upset :)
Stavros Korokithakis
@skorokithakis
ah, huh, very interesting
weeeeeell
you could yield every half second or something
i'm sure the downstream circuit wouldn't even notice