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.

TMS320C6748: getting 2ch data concurrently in upp port

Part Number: TMS320C6748
Other Parts Discussed in Thread: ADS4242

Dear Champs,

My customer developed C6748 custom board by connecting ADS4242 ADC in upp port.

In their test, they found Phase difference between 2ch inputs even when they input same data to ADS4242 concurrently. The amount of phase difference is not same and the difference amount is varied whenever they test it.

They could not verify if it is SW issue or ADC issue yet, and want to check if it is SW issue or not.

Is it possible to get 2ch data concurrently though upp port without any phase delay?

Thanks and Best Regards,

SI.

  • Hi,

    I've notified the team. They will post their feedback directly here.

    Best Regards,
    Yordan
  • Hi,

    My customer has tested more on this issue and it seemed they failed to get 2ch data in upp concurrently, and this is not a issue in ADC setting.

    My customer's latest test was to connected 2ch upp ports to same ADC channel and generate test pattern in ADC. e.g. they connected both A and B channels of upp to same A channel of ADC. They expected same data were found in each upp buffers, but they found there were some difference between A channel buffer and B ch. buffer of upp at each time as below. 

    They also found this difference between A ch and B ch was reduced when they increased CPU frequency.

    e.g. in above table, you can find the difference values were 1 ~ 2 at 300Mhz CPU clock. When they increased CPU clock up to 456Mhz, they found this difference values were reduced to 0 ~ 1 at 456Mhz CPU clock.

    Their SW is non-OS based bare-metal SW as below.

    7242.UPP.C

    Please let me know how they can get both A and B ch of upp concurrently without phase difference.

    Thanks and Best Regards,

    SI.

  • Hi,

    I think this issue was occurred as DMA of ch.A occupied DDR memory resource and thus ch.B can not be received at this time.
    Is this my guess right?

    If so, how they can resolve it?


    Thanks and Best Regards,
    SI.
  • Capturing latest internal email trail on this topic - issue not resolved yet

    If you are suspecting bandwidth/ real time deadline miss type issues - please confirm
    SI) I don’t think so. I’m worrying that the resource like DDR memory was blocked by ch.A of upp, and thus missed data occurred in ch.B.

    1. This is stand alone test with just upp traffic
    SI) Yes. this is standalone test with just upp traffic. There is no other task in their test.

    2. Is there a way to test lower clock for upp interface
    SI) No. they have no idea how they can make ADC clock to be lower.
    But, as I said, the value gap between ch.A and B was reduced when they used higher CPU clock.

    3. If all traffic is in ddr can you see if ddr PBBPR register is at default and if so does changing it to 0x20 make any difference?
    SI) The current PBBPR value is 0x30. When they changed PBBPR to 0x20, the occurrence of GAP was increased. E.g. GAP between A and B was occurred more frequently when they set PBBPR to ‘0x20’.
  • Hi SI

    There is a note in the following wiki that says that in certain 2 channel mode you should be at 50 MHz
    processors.wiki.ti.com/.../Introduction_to_uPP

    1) Can you confirm what is the clock rate for this setup and whether it is internal or external clock.
    2) Can you confirm that the DDR is running at max speed
    3) It is interesting that 0x20 is giving you more issues - can you try a value higher than 0x40.
    4) Is it possible to separate channel A and B to have buffers in different location say one in DDR and other in SHARED RAM to see if it helps.

    Regards
    Mukul
  • Hi Mukul,

    I found there was miscommunication, and there was some wrong in my previous answer sent by e-mail.
    I said there was no other task in their test, but I found there were other tasks using UART0,2, Timer.
    When they tested upp without other tasks, it was OK to receive ch.A and B of upp concurrently, and I'm doubting there is a bus conflict or task priority issue. Are you agree on this? Could you please let me know what is the solution on this?


    Thanks and Best Regards,
    SI.
  • Thanks for the update SI - it is hard to tell that simply 2 UARTs and timer will mess up the data integrity/cause real time bandwidth/latency issues for uPP traffic or if these UART/timer tasks are causing some issues in the software (the way the tasks are handled , interrupt servicing etc).

    To further eliminate whether it is a bandwidth type issue , as I mentioned early try to see if putting traffic/payload on different memories help ie. Put Upp traffic on DDR and UART traffic on Shared RAM or vice versa.

    Doing so from an interconnect perspective you may almost have independent paths.

    Are the UARTs using EDMA or CPU?

    Regards
    Mukul
  • Mukul,

    Their UARTs are using CPU mode, but they newly found UART tasks were not cause this issue, and only Timer cause this issue. e.g. If Timer is disabled(no matter what UARTs are), there is only 1 difference found between ch.A and B and this difference was not changed in increased test mode of ADC. This situation is only observed at 456Mhz CPU clock. At 375Mhz of CPU clock, the difference was changed between 0 and 2 even when Timer was disabled.

    Thanks and Best Regards,
    SI.
  • SI
    What is the timer doing? Is the function completely independent of UPP transfers -data and software wise?
  • Yet. I was completely independent of UPP transfers - data and software wise.
    Moreover, when they changed ADC to normal mode, the difference was varied between 0 ~ 1 even when timer was disabled, and they can not analysis the signal correctly as the difference was varied and they can not estimate what exact difference is between 2 channels.

    Thanks and Best Regards,
    SI.
  • Thanks SI
    As of now I do not think it is a bandwidth or bottleneck type of issue. This is either hardware design or software configuration issue.

    I see there were good set of questions asked by the ADC team
    e2e.ti.com/.../718248

    that were not answered.

    It would be good to understand if the issue is only at start up , maybe share the register configuration with the ADC team to sanity check.

    If this is a start up/timing issue - maybe you will see it go worst with lower CPU frequency? Have you tried anything lower than 300 MHz just as test?
    When you run at 300 Mhz vs 456 MHz, is the CVDD still the same?

    Regards
    Mukul
  • Mukul,

    At this time, just as test, they connected same A ch. of ADC to A and B ch of upp. e.g. same data pins of ADC were connected to both A and B ch data pins of upp concurrently, and other data pins of ADC(e.g. ch.B) were disconnected. This is their configuration to check DSP upp ports and SW. So, I'm not sure if this is ADC related issue or not, and I think we need to make clear DSP related issue first.

    For Timer, they are using timer just to check the performance of FFT. So, there is no need to use Timer at this time, but they are afraid there will be a need to use Timer in other product as they are willing to check all feasibility of C6748 platform at this time before applying it on real product.
    And also, even when Timer was disabled and they set normal mode in ADC, the difference between ch.A and B of upp was varied between 0 ~ 1. This is an issue as they can not compensate it easily.
    Anyway, I'll let them know how to use TSCL registers to measure FFT();


    Do you think it can be an issue to connect 1ch data pins of ADC to 2ch data pins of upp?


    For lower CPU frequency, they found more issues occurred and the difference was increased in lower CPU frequency(200Mhz).

    For CVDD, they are not change CVDD voltage when change CPU frequency and their current CVDD voltage is 1.3V. As they have used the GEL file of our LCDK, they tested it with 300Mhz CPU frequency at first. They modified this GEL file only to increase CPU clock to 456Mhz.

    I can share their source code if you need.

    Thanks and Best Regards,
    SI.

  • Hi SI
    At this point I cannot think of anything else. It is still not looking like a device/bandwidth issue. Running higher speed vs lower speed, there maybe some clock / phase differences/latching wrong data that maybe getting masked at higher core speed vs more prominent at lower core speed.

    It would be good to see if the mismatch only happens during initial samples or anywhere.

    Additionally i see something called adc_sclk sourced from the dsp - what is this and when is it used by the ads4242. Is it a clock source or just a gpio? If it some sort of clock source, changing the core frequency will also change this , i think.
  • Hi Mukul,

    Where you see adc_sclk?  I could not find it.

    Is there any reference design HW and SW to connect ADC to upp port?

    I found there are upp ports in C6748 and C6657/5/4/2, and it would be helpful it there are any examples to connect ADC through UPP 2 channels.

    And also, what does meaning of 2way in below? does this mean full-duplex?

    Thanks and Best Regards,

    SI.

  • Hi SI

    adc_sclk was in the schematic that was shared on the High speed converters forum
    e2e.ti.com/.../718248

    >>Is there any reference design HW and SW to connect ADC to upp port? I found there are upp ports in C6748 and C6657/5/4/2, and it would be helpful it there are any examples to connect ADC through UPP 2 channels.

    Unfortunately, I am not aware of any ADC to upp port hw/sw reference design. It has been a gap on both c674x and c665x family and likely not something we will be addressing.


    >>And also, what does meaning of 2way in below? does this mean full-duplex?
    Yes this means full duplex.
  • Hi Mukul,

    Actually the difference in initial sample is not an issue and they can compensate it in this case.
    But, the problem is the difference is occurred at anywhere and they can not compensate it when they input signal.

    Could you please recommend sample size transferred by DMA at one time from upp?
    I found they received large sample size to process FFT for large sample blocks, and they tried to test with 8192 samples and 16384 samples.
    I'm worrying it takes too much time to I think we need to suggest more efficient architecture like ping-pong buffer. Could you please provide your opinion on this?

    I found below e2e and it seemed block size(sample size) also impact on the performance and this is why I'm asking.
    e2e.ti.com/.../719192



    And also, I found there was a difference between test pattern and input signal. As I said before, there was no issue with test pattern, but they found unexpected difference at anywhere with real signal input. This is an issue to be resolved.
    I found there was only FFT() function is working with real signal input although there was no FFT and only check difference between ch.A and B when they test with test pattern.

    I think 8192pt FFT() function would impact the DMA performance.
    But, my customer don't think this is an issue because they disabled DMA while FFT is working.

    e.g. in their implementation, they got received 2ch 8192 samples each through upp, and disable DMA and run FFT.


    Thanks and Best Regards,
    SI.

  • Hi Si
    I don't see how the size of the transfer will cause data corruption or mis match.
    I am not aware of any recommended data size for DMA, if this is a stand alone system (UARTs, TImers is the only additional traffic) the DMA size should not matter.

    >>e.g. in their implementation, they got received 2ch 8192 samples each through upp, and disable DMA and run FFT.
    Can you explain what you mean here when you say disable DMA.

    Since the customer is seeing corruption without FFT, I don't see the connection?

    The post you pointed to - the customer was experiencing lower performance on the DSP code performance, due to UPP data/interrupts etc. So don't think I see any similarity between this issue and that post.

    Can we recap on what works vs not work
    - Frequency dependency
    - Adjacent traffic (UART, Timers)
    - Test pattern vs Real input signal

    Would appreciate an accurate resummary to see what if any condition makes the test work/pass.

    Regards
    Mukul
  • Hi Mukul,

    Thanks for response, and let me summarize as you requested.

    Summary:

    1. Frequency dependency

      ans) more issues in lower frequency. i.e. the difference is more dynamically varied in lower frequency.

    2. Adjacent traffic (UART, Timers)

      ans) Timer impact the issue, but UART did not.

    3. Test pattern vs Real input signal

      ans) Test pattern : there is no issue at 456Mhz. i.e. always 1 difference occurred between ch.A and B.

                                            there is an issue at 300Mhz. i.e. difference between A and B is varied 1 ~ 2.

                Input signal : there is an issue even at 456Mhz. i.e. difference between A and B is varied 1 ~ 2.

    More information:

    I think I found the difference between Test pattern and Real input signal(above summary 3).

    I found there was no fft function in Test pattern and issue occurred at 456Mhz even with Test pattern when I insert fft function to be executed.

    Based on below their test code, I think I can explain above summary 1 and 2.

    As you see below, they implemented that they always do upp_setup and ADC setup at each iterations. I think the difference will be occurred at this upp_setup() and this is why it was impacted by CPU frequency and Timer ISR.

    And also, I think this flow should be an issue and they need to modify to do upp_setup at initial time only. Are you agree?

    full source code is also attached.

    upp_test.c
    static void ADC_UPP_Test(void)
    {
        volatile unsigned int *pADCChannelA;
        volatile unsigned int *pADCChannelB;
    
        unsigned int lwData;
        unsigned int lwXData;
    
        unsigned int lwIndex;
        unsigned char lbIndex;
        unsigned char lbReadData;
        unsigned int lbErrorCnt;
    
        fft_result lfrCurrentResult;
        fft_result lfrVoltageResult;
    
        ADS4242PWRDown(dDISABLE);
        ADS4242HWReset();
    #ifdef ADC_PATTERN
        ADS4242RegSetup(dTEST_PATTERN_INCREMENT, 0x4567);
    #else
        ADS4242RegSetup(dTEST_PATTERN_NORMAL, 0x4567);
    #endif
    
        for(lbIndex=0;lbIndex<10;lbIndex++)
        {
            lbReadData = ADS4242RegRead(gbaADS4242_RegReadArray[lbIndex]);
            UartPrintf(dDEBUG_PORT, "\n\rADS Reg Read ADDR 0x%02x = 0x%02x",gbaADS4242_RegReadArray[lbIndex],lbReadData);
        }
    
        lbErrorCnt = 0;
        gfFFTLength = dFFT_SAMPLE_LENGTH;
        UPPSetup(dCURRENT_ADC_DATA_ADDR,dVOLTAGE_ADC_DATA_ADDR,gfFFTLength);
        while(1)
        {
            //측정 대기 시간 추가 필요
            if(gwUPPISRCnt)
            {
                ADS4242PWRDown(dENABLE);
                IntEnable(C674X_MASK_INT5); //UART2
                IntEnable(C674X_MASK_INT6); //UART0
                //IntEnable(C674X_MASK_INT7); //Timer
    
    #ifdef ADC_PATTERN
                pADCChannelA = (unsigned int *)dCURRENT_ADC_DATA_ADDR; //DMA-I == UPP_D0 ~ D15
                pADCChannelB = (unsigned int *)dVOLTAGE_ADC_DATA_ADDR; //DMA-Q == UPP_XD0 ~ XD15
    
                FFTProcess(dCURRENT_ADC_DATA_ADDR,dVOLTAGE_ADC_DATA_ADDR,gfFFTLength,5e3,&lfrCurrentResult,&lfrVoltageResult,dENABLE);
    
                for(lwIndex=0;lwIndex<1;lwIndex++)
                {
                    lwData = *pADCChannelA & 0x3fff;
                    lwXData = *pADCChannelB & 0x3fff;
    
                    if((lwXData-lwData) != 1)
                    {
                        lbErrorCnt += 1;
                    }
    
                    UartPrintf(dDEBUG_PORT,"\n\r%d %x \t%x \t%x \t%x \t%d Error Cnt = %d",lwIndex,pADCChannelA,lwData,pADCChannelB,lwXData,lwXData-lwData,lbErrorCnt);
    
                    //exit(1);
    
    
                    pADCChannelA += 2;
                    pADCChannelB += 2;
                }
    #else
                FFTProcess(dCURRENT_ADC_DATA_ADDR,dVOLTAGE_ADC_DATA_ADDR,gfFFTLength,5e3,&lfrCurrentResult,&lfrVoltageResult,dENABLE);
    #endif
                Delay(dDELAY_TIME_100ms);
                Delay(dDELAY_TIME_100ms);
                Delay(dDELAY_TIME_100ms);
    
                ADS4242PWRDown(dDISABLE);
                ADS4242HWReset();
    #ifdef ADC_PATTERN
                ADS4242RegSetup(dTEST_PATTERN_INCREMENT, 0x4567);
    #else
                ADS4242RegSetup(dTEST_PATTERN_NORMAL, 0x4567);
    #endif
                UPPSetup(dCURRENT_ADC_DATA_ADDR,dVOLTAGE_ADC_DATA_ADDR,gfFFTLength);
            }
        }
    }
    

    ~~~~~~~~~~~~

       ADS4242PWRDown(dDISABLE);

       ADS4242HWReset();

       ADS4242RegSetup(dTEST_PATTERN_INCREMENT, 0x4567);

       lbErrorCnt = 0;

       gfFFTLength = dFFT_SAMPLE_LENGTH;

       UPPSetup(dCURRENT_ADC_DATA_ADDR,dVOLTAGE_ADC_DATA_ADDR,gfFFTLength);

       while(1)

       {

           //측정 대기 시간 추가 필요

           if(gwUPPISRCnt)

           {

               ADS4242PWRDown(dENABLE);

               IntEnable(C674X_MASK_INT5); //UART2

               IntEnable(C674X_MASK_INT6); //UART0

               //IntEnable(C674X_MASK_INT7); //Timer

               pADCChannelA = (unsigned int *)dCURRENT_ADC_DATA_ADDR; //DMA-I == UPP_D0 ~ D15

               pADCChannelB = (unsigned int *)dVOLTAGE_ADC_DATA_ADDR; //DMA-Q == UPP_XD0 ~ XD15

               for(lwIndex=0;lwIndex<1;lwIndex++)

               {

                   lwData = *pADCChannelA & 0x3fff;

                   lwXData = *pADCChannelB & 0x3fff;

                   if((lwXData-lwData) != 1)

                   {

                       lbErrorCnt += 1;

                   }

                   UartPrintf(dDEBUG_PORT,"\n\r%d %x \t%x \t%x \t%x \t%d Error Cnt = %d",lwIndex,pADCChannelA,lwData,pADCChannelB,lwXData,lwXData-lwData,lbErrorCnt);

                   pADCChannelA += 2;

                   pADCChannelB += 2;

               }

               Delay(dDELAY_TIME_100ms);

               Delay(dDELAY_TIME_100ms);

               Delay(dDELAY_TIME_100ms);

               ADS4242PWRDown(dDISABLE);

               ADS4242HWReset();

               ADS4242RegSetup(dTEST_PATTERN_INCREMENT, 0x4567);

               UPPSetup(dCURRENT_ADC_DATA_ADDR,dVOLTAGE_ADC_DATA_ADDR,gfFFTLength);

           }

       }

    }

    Thanks and Best Regards,

    SI.

  • Thanks SI

    >>And also, I think this flow should be an issue and they need to modify to do upp_setup at initial time only. Are you agree?

    Have not reviewed all their code and logic, but definitely looks like too much overhead in setting up the upp configuration over and over in the while loop, there should be some things that are just configured initially and then just enable disable transfers as needed?
    IMHO, this should be cleaned up

    For what its worth, you can also increase the uPP to highest priority , when competing with cpu accesses by changing SYSCFG.MSTPRI0.upp priority value from default 4 to 0. I do not think this should make much difference, but you can try.
  • Hi Mukul,

    When I tried to modify SYSCFG.MSTPRI0.upp priority to 0, it didnot help.
    When I create uppenable() function by utilizing upp soft reset described in TRM, it also didn't help.

    As I found there was no missing in DMA copy and just one value slipped in channel B, I'm doubting there should be an issue while data received in internal FIFO. And also, when I checked all values in the buffers, normally there was no issue and always the difference between end value and start value is 8191, but at sometimes, this value is over 8191, and this meant there was missing to receive data in upp. (window size is 8192. So, 8191 is right). this missing was occurred at both ch.A and ch.B.

    Do you have any idea on this?

    Thanks and Best Regards,
    SI.
  • I also found some strange thing.
    As you remember, there was no difference occurred in 456Mhz CPU clock, but I found the difference was occurred even at 456Mhz CPU clock when I inserted FFT() function.
    I think this is the reason the difference was occurred when ADC set to normal mode(not incremental mode) at 456Mhz CPU clock.


    Do you think power can be a issue?
    Their custom board is using USB power. I'm afraid this is not enough to run C6748 DSP and ADC.

    Thanks and Best Regards,
    SI.
  • The exact part name of DSP is TMS320C6746-375Mhz, but they connected 1.3V to CVDD.
    Do you think this can cause this issue?

    Their ADC's output CLOCK frequency connected to upp is 4.096Mhz, and I'm worrying if this is too low.

    Please let me know if you have any idea.

    Thanks and Best Regards,
    SI.
  • Hi SI

    Sorry for the delayed response - unfortunately no bright ideas to further narrow down the issue. Responses to your questions

    As I found there was no missing in DMA copy and just one value slipped in channel B, I'm doubting there should be an issue while data received in internal FIFO. And also, when I checked all values in the buffers, normally there was no issue and always the difference between end value and start value is 8191, but at sometimes, this value is over 8191, and this meant there was missing to receive data in upp. (window size is 8192. So, 8191 is right). this missing was occurred at both ch.A and ch.B.


    Are you saying that it is always the last elements that have an issue? Can you try smaller /different packet/transfer size?


    Do you think power can be a issue?
    Their custom board is using USB power. I'm afraid this is not enough to run C6748 DSP and ADC.


    Hard to say, you  had things somewhat working at lower frequency. I have not seen many USB powered c674x applications. Have they done board power measurements to ensure power is not an issue? Have they tried any other tests to see if they see any failures , if power design is a suspect?

    The 


    The exact part name of DSP is TMS320C6746-375Mhz, but they connected 1.3V to CVDD.
    Do you think this can cause this issue?

    I would recommend sticking to the max frequency supported by the device, so even though you are running the device at 1.3V , since it is a 375 MHz device, runnign at 456 MHz is running it out of spec and while personally i do not think this is the issue - I would recommend doing more testing at 300 MHz or 375 MHz only to root cause the issue. 

    Their ADC's output CLOCK frequency connected to upp is 4.096Mhz, and I'm worrying if this is too low. Please let me know if you have any idea.

    Do they have the ability to change the clock to test. 4 MHz clock does sound low , as upp is capable of higher. Did you confirm my previious query on adc_clk source from the schematic shared in the other e2e forum?

    On your offline query on 3p suggestions for this - unfortunately i am not aware of any 3p that has a working upp+adc solution.

    The only 3p with upp expertise i am aware of is Critical Link. They have boards that have upp to FPGA interface. 

  • Mukul,

    Thanks for your comments.

    I'm sorry and it seemed my short English made you to be confused.
    The issue is that the first sample in ch.B was skipped and stored from 2nd samples in the memory.
    The other issue is there is missing samples found in the middle of both ch.A and B buffers at sometimes.
    e.g. buffer size is 8192. then I can expect 1st buffer element should be 0, and last one should be 8191 as it is incremental by 1. But, at sometimes, the last element was not 8191.

    adc_clk is used as clock in SPI mode and is connected to GPIO in CMOS mode.
    So, adc_clk should be not an issue at this time.

    Thanks and Best Regards,
    SI.
  • OK SI , understood.
    Don't have concrete suggestions here - still don't know if it is a hardware or software issue . The speed/processing dependency makes me think it is a software issue especially because at higher frequency even though you had failures, for the apples to apples setup it seem 456 was slightly better.
    Have you seen if the memory location makes any differences ie. DDR vs L2 etc.
  • Mukul,

    Thanks for your response.
    There is still an issue when ch.B moved to shared memory and the buffer of ch.B was allocated in shared memory. I have not tested it on L2 cache. To test it on L2 cache, I think I should set L2 cache to be freeze. do you have any example to make it freeze?

    I'm afraid there is nothing to do more in SW wise, unfortunately. I implemented it using polling instead of interrupt previously, but issue is the same. I'm afraid there is no way to sync-up between ch. A and B in upp of C6748 or it is their custom HW issue. If there is not a logic to sync-up between ch. A and B, it should be natural the delay in ch.B will be different and could not be robust whenever it was executed, isn't it?
    Is it possible to check their scenario and if the sync-up between ch.A and B when same clock source input?
    Is it possible for you to check with 3P - Critical Link - for sync-up between ch.A and B?

    To change ADC clock output, they need to change crystals for ADC clock input. So, it is not easy.
    if we have any reasonable doubts on this low ADC clock, I will try to persuade them to change crystals, but it is hard to change at this time without any reason. Is it possible to check this also with Critical Link or Factory team?

    I'm afraid it will be the time soon to decide if we will work on this further or give-up this opportunity.

    If you can check with 3P or factory team, it would be very helpful.


    I implemented it using polling, but there was still an issue.
    I have checked their upp register settings, ISR routine, DMA settings, and PINMUX, but I could not find any strange thing and can not resolve issue.


    Thanks and Best Regards,
    SI.

  • Hi Mukul,

    I think I find root cause of this issue although I'm still testing it.
    I think the root cause is the timing of DMA setting between ch.A and ch.B(ch.I and ch.Q).
    I think upp port started to work when DMA setting was done. So, I'm guessing there was time gap to set each DMA channel and this time gap cause the issue, and this explain why the delay gap was small in higher CPU frequency.

    e.g. the original code is

    ~~~~~~~~~~~
    // For DMA Channel I.
    HWREG(SOC_UPP_0_REGS + UPP_UPID0) = ((unsigned long)plwUPP_DATA_ADDR << UPP_UPID0_ADDR_SHIFT);
    HWREG(SOC_UPP_0_REGS + UPP_UPID1) = (lwLineCnt << UPP_UPID1_LNCNT_SHIFT) | \
    (lwByteCnt << UPP_UPID1_BCNTH_SHIFT);
    HWREG(SOC_UPP_0_REGS + UPP_UPID2) = (0 << UPP_UPID2_LNOFFSETH_SHIFT);

    //For DMA Channel Q.
    HWREG(SOC_UPP_0_REGS + UPP_UPQD0) = ((unsigned long)plwUPP_XDATA_ADDR << UPP_UPQD0_ADDR_SHIFT);
    HWREG(SOC_UPP_0_REGS + UPP_UPQD1) = (lwLineCnt << UPP_UPQD1_LNCNT_SHIFT) | \
    (lwByteCnt << UPP_UPQD1_BCNTH_SHIFT);
    HWREG(SOC_UPP_0_REGS + UPP_UPQD2) = (0 << UPP_UPQD2_LNOFFSETH_SHIFT);

    ~~~~~~~~~

    When I changed it as below, I found the delay gap was reduced.

    ~~~~~~~~~
    // For DMA Channel I and Q. interleaved DMA settings
    HWREG(SOC_UPP_0_REGS + UPP_UPID0) = ((unsigned long)plwUPP_DATA_ADDR << UPP_UPID0_ADDR_SHIFT);
    HWREG(SOC_UPP_0_REGS + UPP_UPQD0) = ((unsigned long)plwUPP_XDATA_ADDR << UPP_UPQD0_ADDR_SHIFT);

    HWREG(SOC_UPP_0_REGS + UPP_UPID1) = (lwLineCnt << UPP_UPID1_LNCNT_SHIFT) | \
    (lwByteCnt << UPP_UPID1_BCNTH_SHIFT);
    HWREG(SOC_UPP_0_REGS + UPP_UPQD1) = (lwLineCnt << UPP_UPQD1_LNCNT_SHIFT) | \
    (lwByteCnt << UPP_UPQD1_BCNTH_SHIFT);

    HWREG(SOC_UPP_0_REGS + UPP_UPID2) = (0 << UPP_UPID2_LNOFFSETH_SHIFT);
    HWREG(SOC_UPP_0_REGS + UPP_UPQD2) = (0 << UPP_UPQD2_LNOFFSETH_SHIFT);
    ~~~~~~~~~~~~

    Do you think this my guess is reasonable?

    Current my solution is to enable upp register at last.

    ~~~~~~~~~~~
    //0. Reset the EN bit in the uPP peripheral control register (UPPCR) to 0 to turn off the uPP peripheral.
    HWREG(SOC_UPP_0_REGS + UPP_UPPCR) &= ~(UPP_UPPCR_EN);
    uppcr_status = HWREG(SOC_UPP_0_REGS + UPP_UPPCR) & (UPP_UPPCR_DB);
    while (uppcr_status) {
    uppcr_status = HWREG(SOC_UPP_0_REGS + UPP_UPPCR) & (UPP_UPPCR_DB);
    }

    :
    :
    (upp register settings)

    :

    (DMA channel settings)

    //7. Set the EN bit in the uPP peripheral control register (UPPCR) to 1 to turn on the uPP peripheral.
    // To sync-up between ch.A and B
    saveReg = HWREG(SOC_UPP_0_REGS + UPP_UPPCR) & \
    ~(UPP_UPPCR_EN | UPP_UPPCR_RTEMU | UPP_UPPCR_SOFT | UPP_UPPCR_FREE);
    HWREG(SOC_UPP_0_REGS + UPP_UPPCR) = saveReg | \
    (0x00000001u << UPP_UPPCR_EN_SHIFT);

    ~~~~~~~~~~~~

    Do you have any idea to sync-up each upp port start time better than this?
    Do you think this is right solution to sync-up upp channels?

    At very few times, I found mismatched value between ch.A and B. so, if you have better idea, it would be very helpful.
    And also, in TRM document of C6748, the order of 'upp enable set' was 7th before DMA settings. my solution is to place it in the last.
    I would like to check if there is any reason to place it on 7th order in TRM and it is OK to place it in last after DMA settings.

    Thanks and Best Regards,
    SI.

  • Hi Mukul,

    I finalized this issue by applying all techniques mentioned in above, but still found very few mis-matched sync at sometime and 1~2 mismatched sync found per 10,000 trials in my test.
    So, if you have any idea and share it, it still would be very helpful.

    At first, I applied 'upp_enabled' in the end of DMA settings, but I realized it was not enough although mis-matched syncs were reduced.
    So, I applied all techniques like 'interleaving Q and I DMA settings' and 'raise priority of upp' as below, and I also simplified ISR.

    // highest priority in upp, 2018/09/28, psi
    saveReg = HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_MSTPRI0) & \
    ~(SYSCFG_MSTPRI0_UPP);
    HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_MSTPRI0) = saveReg | \
    (0x00000000u << SYSCFG_MSTPRI0_UPP_SHIFT);


    Thanks again for your support and advice so far.

    I would like to attache full source code in below.

    3107.UPP.C


    Thanks and Best Regards,
    SI.

  • Hi SI

    Thanks for updating the post with the latest status. I apologize for not being able to provide you any additional closure on this - your previously requested need for guidance on 3P route is also not very viable, as I am not aware of any 3P that specifically has uPP with ADC running. 

    Looks like there is some improvement in the overall robustness, but still some failures - where does that leave you with closing this out with the customer?

    Quick glance at the code, I don't find any additional issues to point to. 

    Are the failures still more prominent at lower frequency after implementing all the changes you mentioned in your last post?

    Regards

    Mukul 

  • Hi Mukul,

    Actually I found only 1 failure during 10,000 trials and my customer wants to remove it even it is very rare case. They will test it more and will decide to use C6748 for their product or not.

    Thanks and Best Regards,
    SI.
  • Hi SI
    Thanks for the update. Good to see some robustness overall. Understood that this may still not be enough for your customer to take this to production.
    Please keep us posted if there are any new findings or questions. I think from factory side, I have exhausted the debug process.
    Marking this closed for now as I am not tracking any further action on this. Feel free to reopen as needed.

    Regards
    Mukul