infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

Dave

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: XMC1300 VADC channels with different groups triggered by CCU8

  1. #1
    New Member New Member akshatra is on a distinguished road
    Join Date
    Feb 2017
    Posts
    16
    Points
    210

    XMC1300 VADC channels with different groups triggered by CCU8

    Dear All,

    I am using following VADC channels with groups.

    Code:
    =====================================
    GROUP 0                  GROUP 1
    =====================================
    CH0                          CH1
    CH7                          CH5
                                 CH7
    =====================================
    The VADC should start scan on every rising edge of CCU8(PWM) trigger point.

    How VADC should be configured to achieve this?

    1) I should use Background request source or scan request source or queue request source.

    2) As the channels are from different groups, which technique is to be implemented to achieve this.

    3) When should we use background / scan request / queue request?

    Please guide me.

    Regards,
    Tinchu

  2. #2
    Advanced Advanced
    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    242
    Points
    4488.1640625
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    New Member New Member akshatra is on a distinguished road
    Join Date
    Feb 2017
    Posts
    16
    Points
    210
    Hi,

    I have already read the manual you are suggesting.

    I couldn't understand the concept fully.

    Like

    Whats the difference between Background scan | Scan request | Queue request.

    In my case which will be best solution to use.

    Please guide me the difference at least.

    Regards,
    Tinchu

  4. #4
    New Member New Member akshatra is on a distinguished road
    Join Date
    Feb 2017
    Posts
    16
    Points
    210
    Dear All,

    The part number is : XMC1300 series, XMC1302-Q040X0064

    I have configured CCU8_CCU80 slice for PWM generation.

    As per the configuration SR0 is selected for Interrupt and is working fine, ISR is getting executed.

    But when I m selecting SR1 or SR2, ISR is not executed.

    Below API is being used

    Code:
    /* Connect period match and one match event to SR0 */
    XMC_CCU8_SLICE_SetInterruptNode(SLICE0_PTR, 
                                    XMC_CCU8_SLICE_IRQ_ID_PERIOD_MATCH, 
                                    XMC_CCU8_SLICE_SR_ID_0);
    As per reference manual SR0, SR1, SR2 are connected to.

    Code:
    CCU80.SR0            NVIC;                               Service request line
    
    CCU80.SR1            NVIC;                               Service request line
                        POSIF0.MSETE;
    
    CCU80.SR2           VADC0.BGREQTRI;                      Service request line
                        VADC0.G0REQTRI;
                        VADC0.G1REQTRI;
                        ERU0.OGU03;
                        ERU0.OGU13;
    If I am selecting SR0 then ISR is executed.

    In SR1 also NVIC is there but still ISR is not executed.

    If selecting SR1 or SR2 then ISR is not executed.

    Could any one please explain and guide me.

    Regards,
    Tinchu

  5. #5
    Intermediate Intermediate
    Infineon Employee
    Infineon Employee
    Eric is on a distinguished road
    Join Date
    Mar 2013
    Posts
    38
    Points
    544.6875
    Hello akshatra,

    The difference of Background, Queue and Scan is explained in detail in the mentioned Application note.
    roughly spoken the difference is in the complexity:

    Background: Sample channels independent of groups but in given order. (No sampling at the same time possible)
    Scan: Sample channels per group but in given order.
    Queue: Sample channels per group in user configured order.

    For your application I would use two ADC_MEASUREMENT_ADV APP and the PWM_CCU8 APP and a Interrupt APP.

    Also The example:
    ADC_MEASUREMENT_ADV_XMC45

    Is very close to your project. You only need to add another instance of ADC APP and also connect the PWM event to this APP.
    Unfortunately the Example is only available for XMC4500. But the ADC APPs for XMC4500 and XMC1300 are very similar.

    Best Regards
    Eric
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  6. #6
    New Member New Member akshatra is on a distinguished road
    Join Date
    Feb 2017
    Posts
    16
    Points
    210
    @Eric : Thanks a lot for your kind reply.

    I made the code that uses scan request Source.

    For generating the interrupt I am stuck with one register GxSEVNP(Source Event Node Pointer Register, Group X)

    In this register there are two bit fields : SEV0NP & SEV1NP

    I am not getting the clear difference between these two bit fields and for Scan Request Source which one I should choose.

    Could any one please guide me

    Regards,
    Tinchu

  7. #7
    Beginner Beginner pricesc is on a distinguished road
    Join Date
    Jan 2016
    Posts
    11
    Points
    186.25
    SEV0NP is routing for the queue source event for the associated 'group' (the x in Gx).
    SEV1NP is routing for the scan source event for the associated 'group' (the x in Gx).

    So for scan source event, you need to set up SEV1NP

  8. #8
    New Member New Member akshatra is on a distinguished road
    Join Date
    Feb 2017
    Posts
    16
    Points
    210
    @procesc : thanks a lot for your kind reply.

    As you know I am using the following channels per group.

    Code:
    =====================================
    GROUP 0                  GROUP 1
    =====================================
    CH0                          CH1
    CH7                          CH5
                                 CH7
    =====================================

    Should I go with scan request or queue request?

    How the interrupt will work ... 2 separate ISR will execute or single as I am using two groups.

    Regards,
    Tinchu

  9. #9
    Beginner Beginner pricesc is on a distinguished road
    Join Date
    Jan 2016
    Posts
    11
    Points
    186.25
    I prefer queue because I can select arbitrary group channels in an arbitrary order (think oversampling and out of order sampling). There are quite a lot of ways to get interrupts going for this...I prefer source event on completion of the last converted channel of the queue.
    I'm sure there is a way to do this for scan source, I've just never done it. For the queue method, you would set the ENSI bit of the last entry of the queue. Also, if you set the RF bit of each entry of the queue, they auto reload (so you don't have to reload the queue every interrupt).

    Anyway, if I remember correctly, either way you do it, SEV0NP or SEV1NP defaults to 0b0000, which is service request line 0 of the group x....so you don't necessarily have to modify either. If, for example, you want to enable the interrupt for group 1 service request line 0, once
    everything else is already set up, I think all you have to do is add:
    NVIC->ICPR[0] = (1<<VADC0_G1_0_IRQn);//Clear any potentially pending interrupt
    NVIC->ISER[0] = (1<<VADC0_G1_0_IRQn);//Enable interrupt

    You could do the same for the other groups scan/queue, to give two interrupts.

    I did manage to find a way to route the completion of the queue of one group through the ERU to trigger the start of conversions on another queue, which then generates an interrupt....that would be a one interrupt solution.

  10. #10
    New Member New Member akshatra is on a distinguished road
    Join Date
    Feb 2017
    Posts
    16
    Points
    210
    @pricesc, thanks a lot for your guidance.

    I am facing problem in reading 2 analog pins now out of 5.

    P2.6 -> Vadc Group 0 Channel 0

    P2.7 -> Vadc Group 1 Channel 1


    I have tried even to sense the above single channel, then also I couldn't get the results.

    These 2 pins are always high.

    Are these 2 pins have some specific use which I have to change for making them to work as analog pins?

    The other 3 channels I am reading successfully.

    Please guide me for these 2 pins.

    Regards,
    Tinchu

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.