Part Number: LM8330
Our customer use LM8330, but got PWM issue as below/
Could you help the case?
We have face some PWM problems. After we give the enable, on and dutycycle commands to LM8330, PWM will be pull high to 1.8v but it always stays at 1.8v. When we give other dutycycle commands to LM8330, PWM still stays at 1.8v.
It seems like the enable and on commands are work but the dutycycle command cannot control the PWM signal.
Are there any wrong steps in our command orders or there are some values and settings that we miss it?
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
Can you tell us what the customer is writing to these bits in registers 0x61, 0x69, and 0x71?:
Can you also confirm that the customer is using the correct GPIOs(16-19)?
In reply to Bobby Nguyen:
In reply to Kent Chen42:
Can you provide us with what registers and data you are sending the device? It may help us to understand why we aren't able to toggle the PWM correctly.
Registers and data that we sending to the device are showed below.
The following table shows the process of data sending from the begining to working pwm.
Also we find out that the default value of register 0xD1 and 0x91 must be ff and 80 but they shows 0f and 00 in our device.
Are there any register that we miss to send data to it?
In reply to Arthur Yu:
update the table due to some error occur for Arthur:
Please have your comment on it.
The following table shows the process of sending data from the beginning to working pwm.
Also we find out that the default data of register 0xD1 and 0x91 must be ff and 80 but it shows 0f and 00.
Are there any register that we miss to send?
I apologize for the delayed response. This device is actually unique compared to our other I2C devices because it uses a command script buffer. I am unfamiliar with this kind of design so I had to reach out to the previous engineer who supported this device to try to understand how it works. I believe I figured it out and think I may know why you aren't seeing the output you want.
From the information you have provided, I do not see you writing to the PWMCFG register (0x7E). I also believe you are incorrectly writing to the PWMWP register (0x7D). These two registers need to be used together to write to the PWM ports to generate a duty cycle. (I believe the internal PWMCFG are preset to 0x00 which means they repeat the start script....)
I think it would be easier to walk through an example of how to do this properly.
The example I will do is to set PWM1 port to a 25% duty cycle.
We first need to adjust the pointer of the configuration register to point to the first address for the PWM1 script buffer. This script buffer pointer for PWM1 starts at 32(decimal) and ends at 63(decimal).
1) Register (0x7D) --> Data (0x20h or 32 decimal)
We next need to write to the SET_PWM_command in this script to generate our desired duty cycle. Please not the configuration register is actually a word of two bytes in length unlike most of the other registers. The command to set a 25% duty cycle is controlled by bits 0-7 where 0x00h is 0% and 0xFF is 100%. This gives us a resolution of 8 bits. 8 bits of resolution gives us 256. So to calculate the 25% we need to calculate what to set the duty cycle bits to: (25%/100%)*256=64 (decimal) to achieve a 25% duty cycle. The upper byte needs to be set to 0x40h to let the configuration register know the command we want to use is the "set pwm command." The lower byte we input needs to be 64(decimal) or 0x40 to set the desired duty cycle.
2) Register (0x7E)-->Data1(0x40h)->Data2(0x40h)
Note at this point: because we wrote two bytes into the configuration register, the PWMWP pointer has now moved to 0x21h or 33 decimal
I suspect the data in this register (where the pointer points which is now 0x21h) will be 0x00h so this will implement the "go to start" command which will jump to the first command in the PWM1 script.
At this point we have successfully set the PWM to a 25% duty cycle for PWM1.
If we want to set PWM0 to do the same thing, we would repeat this process but make the pointer for PWMWP point to 0x00h instead of 0x20h.
Let me know if this works for you,
I have a question. I see there is a Branch Command in PWM Script command.
How do I get the value of loopcount and stepnumber? Is there any function to calculate or I just give the value as I like that is defined in the spec?
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.