infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 7 of 7

Thread: Stopping slice timer via an event

  1. #1
    Beginner Beginner tamirmichael is on a distinguished road
    Join Date
    May 2018
    Posts
    7
    Points
    67.5

    Stopping slice timer via an event

    Hello,

    I am using a XMC4400 microcontroller.
    I have an ADC that triggers an interrupt once the measured value is out of bounds, and a DMA line that copies the
    measurement result to SRAM. However, I would like to stop a timer slice as well without software intervention
    and without an external pin. The user manual specifies that a timer can be stopped using an external event (pin toggle) or software, but I
    don't have the time to do it in the DMA ISR - literally every microsecond counts so I must find a way to make the hardware stop the timer for me
    once the ADC out of bounds event takes place and _before_ the ISR is resolved and invoked.
    Is that possible? If so - how?

    Thanks in advance,

    Tamir Michael

  2. #2
    Advanced Advanced
    Infineon Employee
    Infineon Employee
    DRubeša will become famous soon enough
    Join Date
    Jul 2016
    Location
    München
    Posts
    186
    Points
    2782.5
    Hi,

    so just an idea how it can be done:
    For this example I used ADC_MEASUREMENT_ADV and CCU4_SLICE_CONFIG APPs for the proof of concept. Inside of the ADC_MEASUREMENT_ADV APP I set under the "Boundary Settings" tab following settings:

    Click image for larger version

Name:	boundarySettings.PNG
Views:	0
Size:	29.2 KB
ID:	3576

    (your requirements may vary but you get the idea). Then open the CCU4_SLICE_CONFIG APP and under "Function Settings" tab select following settings:

    Click image for larger version

Name:	functionSettings.PNG
Views:	0
Size:	35.1 KB
ID:	3577

    (again correct setting I´ll leave to you...maybe you want only rising edge or you also want to clear the timer not only stop it....play a bit with the options). So currently we have set a generation of boundary flag in case we are out of boundary and we also defined that timer should be stopped in case of event 0. What we need to do at the end is to assign boundary flag as an input event 0 to timer. We do this by selecting "HW Signal Connections..." under "DAVE" menu. There make sure you have the following connection established:

    Click image for larger version

Name:	hwSignalConnections.PNG
Views:	2
Size:	61.0 KB
ID:	3578

    Under "HW Signal Connectivity" you will something similar to this:

    Click image for larger version

Name:	hwSignalConnectivity.PNG
Views:	2
Size:	35.7 KB
ID:	3579

    And that should be it...of course you need to configure all other parameters of ADC and Timer but a functionality that you were interested in should be done like this.

    Best regards,
    Deni
    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
    Beginner Beginner tamirmichael is on a distinguished road
    Join Date
    May 2018
    Posts
    7
    Points
    67.5
    Hi,

    Thanks for your reply.
    I forgot to mention that I do not use Dave here - but the XMC4000 peripheral library instead.
    Can you please clarify how the very last step (i.e. connecting the boundary condition to the event) can be achieved using the library?
    The API of the library suggests that an external pin is needed, but maybe there is a pin that can be used for this purpose?

    Thanks in advance.

  4. #4
    Beginner Beginner tamirmichael is on a distinguished road
    Join Date
    May 2018
    Posts
    7
    Points
    67.5
    Found this in AP32305:

    "6.2.4 Boundary Flag Events in XMC4400, 4200 and 4100 Devices
    XMC4400, 4200 and 4100 devices are able to generate events after a change in a boundary flag. For more
    details, see 7.4 Boundary Flags.
    To generate and handle an event provoked by a boundary flag change:
    1. Enable and configure the comparison mode (Fast Compare Mode or Limit Checker) and its respective
    boundary flag. (See Use Cases Comparator)
    2. Select a service request line in the respective Boundary Flag Node Pointer bitfield (BFLyNP) of the
    Boundary Flag Node Pointer Register (GxBFLNP).
    3. Enable the Interrupt, DMA transfer or Peripheral action for the service request line selected"

    Still, any further advise will be much appreciated.

  5. #5
    Beginner Beginner tamirmichael is on a distinguished road
    Join Date
    May 2018
    Posts
    7
    Points
    67.5
    This is a lot more relevant, actually:

    VADC.G0BFLOUT0 O VADC.G1REQGTK
    VADC.BGREQGTK
    CCU41.IN0L
    CCU80.IN0I
    CCU43.IN0H

    looks like CCU80 can then use external input I to trigger an event to stop the timer.

  6. #6
    Advanced Advanced
    Infineon Employee
    Infineon Employee
    DRubeša will become famous soon enough
    Join Date
    Jul 2016
    Location
    München
    Posts
    186
    Points
    2782.5
    Hi,

    so the last part of the connection between two modules is directly linked to your last post that is a section from a 17.14 Interconnects sub chapter in the User Manual (if everyone is wondering). With the first figure I initialized the Boundary Flag interrupt generation and with second one I defined input to a Timer module that should stop the timer. However, I haven´t define the "real", hardware connection between these two modules. This was done with the ""HW Signal Connections..." menu. DAVE solver "knows" all the possible inputs and output of a module and connects them together based on the connection diagrams such as one that you posted above. Due to the fact that you posted the Boundary flag 0 output of group 0, I defined the same group so I can get the following settings (additionally, I use CCU4 so I can either use CCU41.IN0L or CCU43.IN0H as inputs). Finally, a configuration and XMCLib code should look like this (I´m showing here Timer module part while you mentioned that you already have ADC module set and working).

    Click image for larger version

Name:	sliceConfig.PNG
Views:	0
Size:	7.9 KB
ID:	3581

    (here you can see that I´m using CCU43 slice)

    Click image for larger version

Name:	eventConfig.PNG
Views:	0
Size:	7.9 KB
ID:	3582

    (notice .mapped_input member where input H is selected, if you check your post one more time you will see that CCU43.IN0H directly correlates to my configuration; other options may be different in your case (active level and edge))

    Click image for larger version

Name:	defineEvent.PNG
Views:	2
Size:	3.6 KB
ID:	3583

    (now define previously configured event)

    Click image for larger version

Name:	stopConfig.PNG
Views:	0
Size:	2.4 KB
ID:	3584

    (with this XMCLib function call you define the connection between event (in our case 0) and what should happen with the "stop" functionality)

    And that´s it...if you set the ADC boundary flag interrupt generation for the group 0 properly, you should be fine.

    Best regards,
    Deni
    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.

  7. #7
    Beginner Beginner tamirmichael is on a distinguished road
    Join Date
    May 2018
    Posts
    7
    Points
    67.5
    Hi,

    Thank you.
    Infineon tech support suggested using, among others,

    VADC.G2SR3 O NVIC, Service request 3 of group 2
    GPDMA
    CCU81.IN2J

    I totally missed that in the user manual !

    Thanks again.

+ Reply to Thread

Tags for this 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.