To make pin PA18 work with the timer/counter you need to assign it to the TC peripheral in the PORT peripheral WRCONFIG register. When the timer has been reset it is disabled. The while statement waits until the reset has completed. For details see Section 30.8.1, page 571, in the ATSAMD21 Datasheet. Although not strictly necessary, it ensures that no previous configuration of TC3 interferes with our application. The next step is to reset Timer/Counter TC3 by setting the SWRST bit in the register CTRLA in TC3.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |