P1 PASM clocks, WS2811, and clearing cog ram
Been working on my own WS2811 driver with help from JonnyMac's driver from the P1/P2 demos. Having lots of fun and lots of questions ha. Trying not blow up the forums too much. For now....
1) In the P1 PASM manual, each instruction has a "clocks" number in the Opcode tables. Is that number of cnts it takes to complete that instruction. At 80 Mhz.. the cnts needed for pulse width are 20 cnts, 80 cnts and 48 cnts, 52 cnts for lo and hi bit PWM, respectively. Most instructions in PASM seem to be 4 or 8 clocks, so that is not a lot of room for too many instructions, if I understand the "clocks" correctly.
2) why did JonnyMac "adjust" his pulse width counts with "-9" in his WS2811 pixel driver?
t0h := ustix * ns0h / 1000 - 9 ' pulse widths in ticks (adjusted)
t1h := ustix * ns1h / 1000 - 9
3) I have been getting some random results some times after I reload the same P1 PASM code into RAM (I cleared EEPROM with blank spin code). I checked my code over and over. Of course I could have code wrong, but is there any way I may be reading a location in COG memory that may have some old value? I've confirmed that i'm writting each address before it is used in the code.. but this is PASM and may be different than SPIN. Is there a way to clear COG memory before PASM is loaded when I load my P1 SPIN code?