Skip to main content
harsh2
Associate II
May 23, 2016
Question

SPC560D40L1: Timer

  • May 23, 2016
  • 2 replies
  • 755 views
Posted on May 23, 2016 at 11:21

Dear All

I want to rum a timer in my MCU: SPC560D40L1.

I am using SPC 5studio.

Please advise, if i can generate the code for any specific duration timer or what documents i should refer to rum a timer.

Awaiting for your kind reply.

Thanks in advance !!

Harsh

#bolerod #pit
    This topic has been closed for replies.

    2 replies

    procolo
    Visitor II
    May 24, 2016
    Posted on May 24, 2016 at 10:47

    Hi Harsh,

    you can use PIT timer. It's an array of timersthat can be used to raise interrupts. please refer to reference manual RM0045 chapter

    Your Platform has 4 timers one of which is used by spc5studio for system tick generation, so you can use PIT1 for your purposes.

    Attached you can find a main.c explaining how to configure and manage interrupt coming from pit1. To try it, import RLA SERIAL test app using the wizard and change the main.c file with this one.

    Please note that starting from next release, PIT driver will be included in spc5studio , so you'll be able to configure it using the graphical interface.

    Regards,

    Procolo

    ________________

    Attachments :

    main.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtgI&d=%2Fa%2F0X0000000aVg%2F7x47G2_IHQoSnUE6pU1O1YBOSOdfJU7hvZMsY_.2GSw&asPdf=false
    harsh2
    harsh2Author
    Associate II
    May 31, 2016
    Posted on May 31, 2016 at 07:10

    Thanks a lot Procolo... it works...

    Regards

    Harsh