This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Replies: 20
Views: 985
Part Number: LM8330
Dear Team:
Our customer use LM8330, but got PWM issue as below/
Could you help the case?
Hi Thomas,
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?
Hey Thomas,
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)?
-Bobby
In reply to TRX Bobby:
In reply to Kent Chen42:
Hey Kent,
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.
Thanks,
Hi Bobby,
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?
Arthur
In reply to Arthur Yu:
Hi Bobby
update the table due to some error occur for Arthur:
Register
Data
0x81
84(default:00)
0x84
01(default:00)
0x8B
00(default:00)
0x03
0x88
0xA7
11(default:None)
0x8A
04(default:00)
0x7D
27(default:00)
0x7C
12(default:00)
0x68
0x69
06(default:00)
0x7A
02(default:00)
0x7B
0x91
Please have your comment on it.
Thanks
Kent
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.
84(default:84)
01(default:None)
00(default:22)
12(default:None)
Are there any register that we miss to send?
Hello Arthur,
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?