Espruino Wifi/Pico PWM differences #5457
Replies: 1 comment
-
Posted at 2016-10-15 by Ollie I had some fun with ESP8266 and 422mHz sockets a few months back, but it did work. I planned to try infrared on ESP8266 so am interested to see how you go on. Re the cpu - you can test at the slower clock speed for yourself with this command: Posted at 2016-10-15 by Adam great idea! Just tried setting the wifi to the system clock speed as the pico with
but unfortunately it made no difference. Posted at 2016-10-15 by Ollie Sorry to hear. One other thought, if you turn off the Wifi does this help? That's also an obvious difference to the Pico - the wifi module for Espruino Wifi includes a I also have both the Wifi and the Pico, so maybe I try this too. Posted at 2016-10-15 by ClearMemory041063 Some ideas to try: Posted at 2016-10-17 by @gfwilliams I'll take a look at this in the next few hours. Seems strange though as it's basically the same chip as on the Pico (albeit with more memory and a higher clock speed) - about all I can think is the higher clock speed might be throwing off the PWM timings, but I'll check this. The only other thing I can think is that the WiFi's timing is actually more accurate - because it has an external low speed oscillator. If you recorded the IR signal on the Pico then the WiFi might replay it at a very slightly different speed. There shouldn't be more than 2% in it, but I guess that could be enough. Posted at 2016-10-17 by Adam to make things stranger~, I generated the pwm data directly from https://github.com/z3t0/Arduino-IRremote instead of recording it. The same data and frequency also work correctly on an Arduino mega 2560. I'll try recording with the wifi. Maybe it's time to invest in a scope :) thanks for all the help! Posted at 2016-10-17 by @gfwilliams Actually I just spotted - you're running PWM at 35000 Hz? Most things I've seen expect 38000 or 40000 Having just tested on a scope, the PWM itself works great. However, digitalPulse is producing wildly varying pulse widths. It looks like a problem with the Wifi's firmware. The quick hack for this is to short out one of the little white capacitors by the crystal. That'll force it to use the internal oscillator, which fixes the problem (I just tested this and it works great). In the mean time I'll try and get a fix in the firmware - the Espruino boards use a relatively complicated arrangement to allow them to get high-res timing that is in sync with the real-time clock, and it looks like that's playing up. Posted at 2016-10-17 by Adam I thought the same thing, but for some reason panasonic tvs use 35000 according to https://github.com/z3t0/Arduino-IRremote/blob/master/ir_Panasonic.cpp#L24 (or I've completely misunderstood!) that's great news that's you've found an issue, thanks for taking the time to look into this Posted at 2016-10-17 by @gfwilliams Ok, should be fixed now! Just do an advanced flash with the URL of the Easiest way to test is just do: Posted at 2016-10-17 by Adam perfect! the latest commit has completely fixed my issue, consider this issue solved. thanks all! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-10-15 by Adam
Hello :)
I'm having a bit of trouble with the Espruino Wifi pwm pins. My aim is to control my TV via infrared.
Running the code below with the same LED on a Pico has a 100% success rate of powering on my TV, however the Wifi is only able to work 3/10 times.
As far as I can tell from the board pinout, A5 and A6 have the same features for both the pico and wifi.
Both boards are running 1v87.
Is it possible that the faster cpu in the wifi is breaking the PWM timings?
Beta Was this translation helpful? Give feedback.
All reactions