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.

  • TI Thinks Resolved

LM8330: Customer got LM8330 PWM issue

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?

  • Hi Thomas,

    We can check into this. Can you please let us know the register configuration/command sequence that is being used to set up the PWM signal? Then we can see if any modifications are needed.

    Thanks,
    Max
  • 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 Bobby Nguyen:

    Hi Bobby
    I am Wistron EE and check this quest with Thomos.
    For register 0x61, 0x69, and 0x71 we all check for these registers, and these are all correct.
    And for GPIO16-16 are also correct, too.
    Any other suggestions that we can try more?

    Thanks
    Kent
  • 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,

    -Bobby

  • In reply to Bobby Nguyen:

    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.

    Register Data
    0x81 84 (default: 84)
    0x84 00 (default: None)
    0x8B 00 (default: 00)
    0x03 00 (default: 22)
    0x88 00 (default: 00)
    0xA7 11 (default: None)
    0x8A 04 (default: 00)
    0x7D 27 (default: 00)
    0x7C 12(default: None)
    0x68 00 (default: 00)
    0x69 06 (default: 00)
    0x7A 02 (default: 00)
    0x7B 02 (default: 00)
    0x88 01 (default: 00)
    0x91 04 (default: 00)

    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?

    Thanks,

    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

    00(default:00)

    0x88

    01(default:00)

    0xA7

    11(default:None)

    0x8A

    04(default:00)

    0x7D

    27(default:00)

    0x7C

    12(default:00)

    0x68

    00(default:00)

    0x69

    06(default:00)

    0x7A

    02(default:00)

    0x7B

    02(default:00)

    0x88

    01(default:00)

    0x91

    04(default:00)

    Please have your comment on it.

    Thanks

    Kent

  • In reply to Kent Chen42:

    Hi Bobby

    Registers and data that we sending to the device are showed below.

    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.

     

    Register

    Data

    0x81

    84(default:84)

    0x84

    01(default:None)

    0x8B

    00(default:00)

    0x03

    00(default:22)

    0x88

    01(default:00)

    0xA7

    11(default:None)

    0x8A

    04(default:00)

    0x7D

    27(default:00)

    0x7C

    12(default:None)

    0x68

    00(default:00)

    0x69

    06(default:00)

    0x7A

    02(default:00)

    0x7B

    02(default:00)

    0x88

    01(default:00)

    0x91

    04(default:00)

                                                                                                                                                                                    

    Are there any register that we miss to send?

     

    Thanks,

    Arthur

  • In reply to Arthur Yu:

    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,

    -Bobby

  • In reply to Bobby Nguyen:

    Hi Bobby,

    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?

    Thanks,

    Arthur

  • In reply to Arthur Yu:

    Hey Arthur,

    The loop count is 6 bits so if you wanted to loop 0 times you would write bits 7 though 12 to be 0 and if you wanted to loop 63 times then you would set bits 7 through 12 to be 1s. if you wanted 33 for example you would do 100001.

    Step number in this case does NOT refer to how large you increment a counter each iteration. Step number is related to the address (how you address) if you set bit 6 to a zero then you will use absolute addressing mode and will jump to the address you specified. If you set bit 6 to 1 then you are now using relative addressing and will move the pointer (for the script buffer) backwards to the amount you specified. Step number in this case does NOT refer to how large you increment a counter each iteration.

    Thanks,
    -Bobby

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.