Good afternoon,
I am having some issues changing PWM functionality between PIOs. When the higher PIOs are used (9, 10, 11) I have no issues. However, when I attempt to use some of the lower PIOs (3 and 4) they do not work. Ideally I could look through the registers to determine what is happening, but I can't seem to find any documentation of the registers inside the CSR1010. I found another post stating that the register documentation is not available. Does anyone know if that is a true statement? I find it hard to believe that anyone can develop a quality product with that information missing.
I started looking through the source code and found a few interesting lines. In the PioFastPwmSetWidth function of the mesh light code it sets a few values based on a passed PIO number. First it sets the bright width (8 bits) at a set address plus an offset for the register number. Then it increments the address by 4 and sets the dull width (8 bits) in the same manner. With 16-bit registers this means that there are 16 * 4 / 8 = 8 PIOs in that address space. However, there are 12 PIOs. Since it is the higher PIO numbers that work, the write of the bright width is occurring in the register area that appears to be for the dull width of the lower PIOs. How is that possible?
The above is my interpretation of the code. However, that function has magic numbers, strangely named variables and no comments which severaly affect the readability.
Any help would be greatly appreciated especially if it is in the form of a register map of this part.
Glenn
Glenn,
The code you see on CSR mesh light is NOT PWM. its a code to call the inner 8051 asm.
Look for file *.asm to learn.