These are chat archives for Makuna/NeoPixelBus

27th
Dec 2016
Victor Tseng
@Palatis
Dec 27 2016 17:58
@Makuna hello, is it possible to use UART0 on esp8266 for ws2822b?
i'm using i2s, IO2, IO3, IO15 are all occupied.
Michael Miller
@Makuna
Dec 27 2016 19:23
@Palatis It might be possible. I just don't think it has been attempted.
Victor Tseng
@Palatis
Dec 27 2016 21:26
hmm... I placed the bitbang routine into timer1 isr, and used NMI for that...
i can update at most 3 pixels (9 * 8 bits) without getting the esp to hang
and no ill-behavior
with 10 ping windows (200ms interval)
Michael Miller
@Makuna
Dec 27 2016 21:34
On Esp8266, the WiFi low level interrupt can be masked for a short period of time; but not long. It depends on how much network traffic you have. Try increasing the pings to 100ms or even 50ms and see if 3 pixels still works correctly.
When you state NMI above, what exactly do you mean exactly. NMI just stands for None Maskable Interrupt.
Victor Tseng
@Palatis
Dec 27 2016 21:36
yeah i only want to update 3 or 4
yeah non-maskable interrupt
Michael Miller
@Makuna
Dec 27 2016 21:36
"used NMI for that" what do you mean.
Victor Tseng
@Palatis
Dec 27 2016 21:36
trigger timer1 edge interrupt with NMI
ETS_FRC_TIMER1_NMI_INTR_ATTACH(ws2812_timer1_isr_handler);
timer1_enable(0 /* div by 1 */, 0 /* EDGE */, false);
exactly this
Michael Miller
@Makuna
Dec 27 2016 21:37
So you are stating without being inside the timer1 ISR (configured for NMI) it doesn't even update 3 pixels?
Victor Tseng
@Palatis
Dec 27 2016 21:38
nope without wifi traffic
3 is the maximum
4 will crash the esp
i'm ping-ing with 0.2s because linux ping doesn't allow me to go lower
so I opened 10 terminals and ping-ing the esp
Michael Miller
@Makuna
Dec 27 2016 21:42
Bitbang just will never work on Esp8266 without "unsupported" techniques. I talked with Espresif and they stated it will just never work. From one SDK to another they change stuff. It used to work as is for about 3-4 pixels without being in the timer NMI ISR. I guess not anymore.
Victor Tseng
@Palatis
Dec 27 2016 21:43
feels like the only possible "no-prob" method that works for me would be UART0 (IO1).
if i want to update more than 3 pixels
sigh... used all the pin
ouch, crashed
so maybe 2
crashed after 135 sec
or use an APA102 (DotStar)
Michael Miller
@Makuna
Dec 27 2016 21:45
You could branch my library, modify the uart method to the other uart and see if it works.
Victor Tseng
@Palatis
Dec 27 2016 21:46
yeah am trying to do that
not familiar with the low level stuff (with esp8266 i mean)
too bad we can't program the RTC mcu and use IO16 to drive the pixels
Michael Miller
@Makuna
Dec 27 2016 21:49
I will give it a try at some point. If you want to make sure I do that create an issue to track it ;-)
Victor Tseng
@Palatis
Dec 27 2016 21:49
no prob i can probably do it on my own and submit PR :-D
all rite! running for 450s without crashing...
Michael Miller
@Makuna
Dec 27 2016 21:52
Hope your familiar with templates, I use them a lot ;-)
Victor Tseng
@Palatis
Dec 27 2016 21:52
however i have no idea if the crash is caused by SSL or NMI...
yeah I do a lot tempate meta-programmings
Michael Miller
@Makuna
Dec 27 2016 21:53
If you are willing, add an entry in the FAQ about using the timer ISR configured with NMI to get bitbang working with 3 pixels (or is it just two?).
Victor Tseng
@Palatis
Dec 27 2016 21:54
2 should work with no prob, experimenting with 3, 4 will definitely crash.
Michael Miller
@Makuna
Dec 27 2016 21:57
Did you try just two outside the timer ISR?
Victor Tseng
@Palatis
Dec 27 2016 21:57
yeah i did, flickers (update fail) during network traffic. I'm keep updating the pixels to create an animation, 120fps ftm.
Victor Tseng
@Palatis
Dec 27 2016 22:14
3 pixels survives ~200sec
says you can "probably" hold NMI for 7500 cycles
but dunno if it's for a 80Mhz or 160Mhz, or Mhz doesn't matter
48bit * 200cycle/bit is probably at the margin
probably have to buy some APA102 for experiment...
got only 1 pin left, maybe I can use the data pin together with some other pins
Michael Miller
@Makuna
Dec 27 2016 22:20
APA102 will require two pins, one is the clock and so it becomes bullet proof of any interrupts; but at the cost of an extra pin.
Victor Tseng
@Palatis
Dec 27 2016 22:22
well, maybe I can connect some peripherals together
I have a analog mux (74hc4051) which takes 3 pins to select the channel, which connects to the A0
so maybe I can take one of the address pin and use it as DATA
have a dedicated clock pin
Michael Miller
@Makuna
Dec 27 2016 22:24
how much do those costs? I always wondered if adding a small AVR as a IO extender would be interesting.
Victor Tseng
@Palatis
Dec 27 2016 22:24
$0.12 for the mux
$0.7 per LED
errg, is it 0.7?
Michael Miller
@Makuna
Dec 27 2016 22:25
(my library also works on AVR)
Victor Tseng
@Palatis
Dec 27 2016 22:25
let me search that
no... $100/lot (1ku)
so ~0.1
so $0.1 * 3 + $0.12 = $0.45
there's no avr you can buy for $0.45
i used to use a n79e8432 which costs ~$1.3 @ 1ku
Michael Miller
@Makuna
Dec 27 2016 22:27
nope, I think the cheapest is $.85, but its pretty limited, but for about $2 you get something reasonable.
Victor Tseng
@Palatis
Dec 27 2016 22:28
t85 is around $1.5
avr is expansive
sk9822 $100/1ku, APA102C $95/1ku
since I don't care which mux channel is selected when i'm not reading it
apa102 style LED might do
and apa102 ignores data when there's no clock
sigh
i2s... fucked up!
Michael Miller
@Makuna
Dec 27 2016 22:32
You can use software for apa102
Victor Tseng
@Palatis
Dec 27 2016 22:32
yeah
that's what i'm thinking
but i got no apa102 around
and they only sell lots
do sk9822 or apa102 need an external cap?
the power source is not very far away, tho.
it's will be soldered on the pcb beside the 8266
Michael Miller
@Makuna
Dec 27 2016 22:36
hack or profesional? An isolating cap is always good, longer strips of them a good power cap helps with fast light changes (from low to high brightness to keep power from sagging).
Victor Tseng
@Palatis
Dec 27 2016 22:37
the power trace will not be very long, and the adapter should be capable of delivering up to 800mA
i got a speaker to run
but anyway since i'm not the one doing the soldering i'll just put a cap there, anyway.
Michael Miller
@Makuna
Dec 27 2016 22:39
I found once that noise on the power line (from another digital device) caused issues, this where a 0.1uf cap to help isolate the pixels helped.