Chat freely about anything...

User avatar
By sfranzyshen
#9714 right now the tpm2net code loops getting packets of data until a full frame is recieved ... it then fires off that full frame of data to the ws2812 code ... where it disables the iterrupts ... loops through the full frame bitbanging the gpio until complete ... the interrupts are re-enabled ... and the cycle is then repeated. (over and over again ...) I can not see a way to combine these two code(s) together ... for example

the tpm2net code recieves a packet of data ... it then send that packet of data to the ws2812 code ... where it disables the iterrupts ... loops through the packet bitbanging the gpio until complete ... the interrupts are re-enabled ... control is returned to the tpm2net code to receive the next packet ... hoping that a large enough delay doesn't happen to cause a reset (end of frame) ... this method would certainly fail ... because the timing could not be guaranteed for the full frame ...

the only reason we are disabling the interrupts, is to prevent our timing (blocking while loops) from getting skewed ...

1)we still don't know if this code is the problem ... or the host software (and if it is this code)
2)we still don't know if the interrupt blocking is a problem ... or if a drift in the timing over 512 pixels is emerging ...

Here's part of the assembly code for the ws2812.c file ... anyone want to see if they can refine/improve things here ...

Code: Select all   .literal_position
   .literal .LC0, 1610613504
   .align   4
   .global   SEND_WS_0
   .type   SEND_WS_0, @function
SEND_WS_0:
   l32r   a3, .LC0
   movi.n   a2, 1
   memw
   s32i.n   a2, a3, 0
   memw
   s32i.n   a2, a3, 0
   memw
   s32i.n   a2, a3, 0
   memw
   s32i.n   a2, a3, 0
   movi.n   a4, 0
   movi.n   a2, 9
.L3:
   addi.n   a2, a2, -1
   memw
   s32i.n   a4, a3, 0
   extui   a2, a2, 0, 8
   bnez.n   a2, .L3
   ret.n
   .size   SEND_WS_0, .-SEND_WS_0
   .literal_position
   .literal .LC1, 1610613504
   .align   4
   .global   SEND_WS_1
   .type   SEND_WS_1, @function
SEND_WS_1:
   l32r   a3, .LC1
   movi.n   a2, 8
   movi.n   a4, 1
.L7:
   addi.n   a2, a2, -1
   memw
   s32i.n   a4, a3, 0
   extui   a2, a2, 0, 8
   bnez.n   a2, .L7
   memw
   s32i.n   a2, a3, 0
   memw
   s32i.n   a2, a3, 0
   memw
   s32i.n   a2, a3, 0
   memw
   s32i.n   a2, a3, 0
   memw
   s32i.n   a2, a3, 0
   memw
   s32i.n   a2, a3, 0
   ret.n
   .size   SEND_WS_1, .-SEND_WS_1
   .literal_position
   .literal .LC4, 1610613504
   .align   4
   .global   ws2812_out
   .type   ws2812_out, @function
ws2812_out:
   addi   sp, sp, -16
   movi.n   a5, 0
   s32i.n   a12, sp, 8
   extui   a12, a3, 0, 16
   movi.n   a3, 1
   s32i.n   a13, sp, 4
   mov.n   a4, a3
   mov.n   a13, a2
   mov.n   a2, a5
   s32i.n   a0, sp, 12
   call0   gpio_output_set
   call0   ets_intr_lock
   bnez.n   a12, .L9
.L19:
   call0   ets_intr_unlock
   l32i.n   a0, sp, 12
   l32i.n   a12, sp, 8
   l32i.n   a13, sp, 4
   addi   sp, sp, 16
   ret.n
.L9:
   addi.n   a3, a12, -1
   addi.n   a10, a13, 1
   extui   a3, a3, 0, 16
   l32r   a4, .LC4
   mov.n   a2, a13
   add.n   a10, a10, a3
   movi.n   a5, 1
   movi.n   a6, 0
.L20:
   l8ui   a9, a2, 0
   movi.n   a8, 8
   movi   a7, 0x80
.L18:
   bany   a7, a9, .L10
   memw
   s32i.n   a5, a4, 0
   memw
   s32i.n   a5, a4, 0
   memw
   s32i.n   a5, a4, 0
   memw
   s32i.n   a5, a4, 0
   movi.n   a3, 9
   j   .L11
.L10:
   movi.n   a3, 8
.L13:
   addi.n   a3, a3, -1
   memw
   s32i.n   a5, a4, 0
   extui   a3, a3, 0, 8
   bnez.n   a3, .L13
   memw
   s32i.n   a3, a4, 0
   memw
   s32i.n   a3, a4, 0
   memw
   s32i.n   a3, a4, 0
   memw
   s32i.n   a3, a4, 0
   memw
   s32i.n   a3, a4, 0
   memw
   s32i.n   a3, a4, 0
.L17:
   addi.n   a8, a8, -1
   srli   a7, a7, 1
   bnez.n   a8, .L18
   j   .L23
.L11:
   addi.n   a3, a3, -1
   memw
   s32i.n   a6, a4, 0
   extui   a3, a3, 0, 8
   bnez.n   a3, .L11
   j   .L17
.L23:
   addi.n   a2, a2, 1
   bne   a2, a10, .L20
   j   .L19
   .size   ws2812_out, .-ws2812_out
   .literal_position
   .align   4
   .global   ws2812_init
   .type   ws2812_init, @function
ws2812_init:
   addi   sp, sp, -32
   s32i.n   a0, sp, 28
   call0   ets_wdt_disable
   movi.n   a4, 0
   mov.n   a2, sp
   movi.n   a3, 3
   s8i   a4, sp, 0
   s8i   a4, sp, 1
   s8i   a4, sp, 2
   call0   ws2812_out
   l32i.n   a0, sp, 28
   addi   sp, sp, 32
   ret.n
   .size   ws2812_init, .-ws2812_init


:mrgreen:
User avatar
By sfranzyshen
#9715
folny82 wrote:No matter how many LEDs you use for testing in channel settings for more than 1465 cease to illuminate all LEDs

ok, can you then reset the host software to something lower (then 1465) and resume and it work? ... or do you need to restart the esp8266?
after the lights go out ... is the wifi still working? Can you connect to the web server? or is the esp locked up?

If the esp8266 is still operational after failure (no reset needed to get working again) ... then I would suspect the host software ... or another issue (network fragmentation) all together ... since you have added this to webbase ... what sort of debugging do you have ... do you have the uart debug logging?
User avatar
By sfranzyshen
#9716 Have you tried other host software?

both the pixelcontroller & glediator led host software have tpm2net output ... I have had problems with glediator going that high ... but I have had pixelcontroller configured for a 16x32 matrix using the tpm2net protocol ... and no special mapping. Of course I do not have 512 leds ... so I can not confirm it is actually working ... but the first 182 leds are running (using the 512 data output)
User avatar
By folny82
#9717 I think the problem is in the software or on the network as ESP not ice is not restart when adding more channels than 1465 Tried and Software pixelcontroller-2.1.0-RC1 but nor did it I could not steered 512 LEDs. To Web_base work I just copied to the directory C: \ Espressif \ examples \ Web_base \ app \ user tpm2net.c, tpm2net.h, ws2812.c, ws2812.h defined set Web_base \ app \ include \ user_config.h: #define USE_ESPCONN 1 and add user_main.c #include "tpm2net.h",
#include "ws2812.h", ws2812_init(); tpm2net_init();