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.

CCS/UCD3138: UCD3138HSFBEVM-029: DPWM SYNC

Part Number: UCD3138

Tool/software: Code Composer Studio

Hello, I was recently learning the UCD3138HSFBEVM_029 demo board, and can't understand the "sync" functions depply, there are two problems I want to ask help.

1. I set : LoopMuxRegs.SYNCCTRL.bit.SYNC_DIR = 1. And check "LoopMuxRegs.SYNCCTRL.bit.SYNC_IN == 0"  when I pull down the SYNC(TP46) to GND. But I noticed all the bits of the " LoopMuxRegs.SYNCCTRL" are equal to 1 when supply to the board.  I guess if there are other settings about "LoopMuxRegs.SYNCCTRL" , but I can't find. I expect to know the reasons.

2. Moreover, I noticed the “EXT_SYNC_EN” register in “DPWMCTRL1”, and there are two notes: "Setting the EXT_SYNC_EN bit causes the DPWM to use the Sync In pin as a source for Sync" and "Slave DPWM to external sync", I am confused about this, I want to let DPWMs(different Demo boards)  timing consistently,  how can I setting the registers? 

Looking forward to your reply,  thank you very much!

  • I assume that when you say all the bits are 1, you actually mean all the active bit fields. I see that too, unless I pull the pin down.

    To do the sync, you just need to leave everything else at default, and set the EXT_SYNC_EN bit in the DPWM you want to sync to. That way the input from the sync pin will also be used for the sync input to the DPWM. You can run a signal from the other device to the sync pin. You can either run a DPWM signal, or you can use the sync pin on the other device as an output, in which case you need to use the SYNCCTRL registers to make that sync pin and output, and decide which DPWM sync signal to output.
  • Thank you very much!
    I test the board many times, when I set the 8 pin (ADC_EXT_TRIG/TCAP/SYNC/PWM0) as ADC_EXT_TRIG mode, it can operate normally(both input and output). However, when work in SYNC mode, It only can work in output mode and can't work in input mode. I don't know whether the codes has been written right or not:
    "MiscAnalogRegs.IOMUX.bit.EXT_TRIG_MUX_SEL = 2; //SYNC function
    LoopMuxRegs.SYNCCTRL.bit.SYNC_DIR = 1; //SYNC work as input pin"
    Moreover, I check the "LoopMuxRegs.SYNCCTRL.bit.SYNC_IN" value when I pull down or pull up, it is always equal 1. I think there should have errors in my codes, and expect you give me some suggestions.

    Looking forward to your reply, thank you!
  • OK, I believe I've figured it out.  I've got it working on my board.  The knot that needs to be untied is that there are built in conflicts between the IOMUX registers, and priority is not documented.  And your configuration has the lowest priority.  With the IOMUX setup you describe, you're actually asking the SYNC pin to be in three places. 

    You're asking it to be on the EXT_TRIG pin, of course. 

    You're also asking it to be on the TCK pin, probably, because the chip goes to a 2 in the JTAG_CLK_MUX_SEL field of IOMUX.  The UCD3138 puts a 2 in this field even if it goes to ROM mode directly.  All the later family members put in a zero in ROM mode, but if they go direct to flash with a valid checksum, they also put in a 2.  We do this to make sure that JTAG is disabled to preserve code security. 

    And you're asking it to be on the SYNC pin as well, because there's a zero in the SYNC_MUX_SEL field.

    So to get it to work, I took your setup and wrote a 0 to JTAG_CLK_MUX_SEL, and a 1 to SYNC_MUX_SEL.  I think you can put other values in those two, as long as you don't select SYNC in either one. 

  • I got it, Thank you very much!