<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pause function on the 5213 in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/pause-function-on-the-5213/m-p/135603#M1630</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;alright, so i think i've solved this problem...using relative counter values and just rolling a single counter over...here is the code i use:&lt;BR /&gt;&lt;BR /&gt;//start the dma0 timer running! 1us resolution, rollover...&lt;BR /&gt;void setupWaitTimer()&lt;BR /&gt;{&lt;BR /&gt;MCF_DTIM_DTER(0) = MCF_DTIM_DTER_REF | MCF_DTIM_DTER_CAP;&lt;BR /&gt;MCF_DTIM_DTMR(0) = 0&lt;BR /&gt;| MCF_DTIM_DTMR_PS(sys_clk_khz / 1000)&lt;BR /&gt;| MCF_DTIM_DTMR_ORRI&lt;BR /&gt;| MCF_DTIM_DTMR_FRR&lt;BR /&gt;| MCF_DTIM_DTMR_CLK_DIV1&lt;BR /&gt;| MCF_DTIM_DTMR_RST;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void my_pause(int usecs)&lt;BR /&gt;{&lt;BR /&gt;uint32 temp = 0;&lt;BR /&gt;&lt;BR /&gt;temp = MCF_DTIM0_DTCN;&lt;BR /&gt;&lt;BR /&gt;if((temp+usecs)&lt;BR /&gt;while(MCF_DTIM0_DTCN&amp;gt;(temp+usecs))&lt;BR /&gt;;&lt;BR /&gt;while(MCF_DTIM0_DTCN(temp+usecs))&lt;BR /&gt;;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and just call my_pause() to delay for a while!! seems to work pretty well!&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Nov 2006 16:22:28 GMT</pubDate>
    <dc:creator>airswit</dc:creator>
    <dc:date>2006-11-17T16:22:28Z</dc:date>
    <item>
      <title>pause function on the 5213</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/pause-function-on-the-5213/m-p/135601#M1628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was wondering if there is anyone that can help me with creating a delay function for the 5213 that can be used by several tasks, and be able to interrupt each other. I am in need of a single function that can be used to delay the system for a given number of microseconds. I have tried to create this by using the DMA timers (there is a function that freescale gave, but it only can be run by 1 function), and i modified it to check to see if the specific timer is in use, and if it is, skips to the next one. i was hoping this would work, but sometimes the system will hang within the my_pause() funciton, waiting for the timer to run over.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I cannot use different functions, really, either, because of the fact that any order of interrupts may trigger, so it would be impossible to assign each isr to use a different timer. also, i tried a while back to implement this using a queue (dynamic memory allocation) and 'semaphores', but that didn't work (though it worked on a windows machine, compiled with visual c++), so i am out of ideas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have anything that i might be able to use, or any hints as to where i can go with this?!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have attached the code that i thought would work below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void my_pause(int usecs)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint8 i;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Enable the DMA Timer 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN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&gt;break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 07:01:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/pause-function-on-the-5213/m-p/135601#M1628</guid>
      <dc:creator>airswit</dc:creator>
      <dc:date>2006-11-07T07:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: pause function on the 5213</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/pause-function-on-the-5213/m-p/135602#M1629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;nothin, huh?! that sux...maybe i'll move to a pic!!&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 04:18:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/pause-function-on-the-5213/m-p/135602#M1629</guid>
      <dc:creator>airswit</dc:creator>
      <dc:date>2006-11-09T04:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: pause function on the 5213</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/pause-function-on-the-5213/m-p/135603#M1630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;alright, so i think i've solved this problem...using relative counter values and just rolling a single counter over...here is the code i use:&lt;BR /&gt;&lt;BR /&gt;//start the dma0 timer running! 1us resolution, rollover...&lt;BR /&gt;void setupWaitTimer()&lt;BR /&gt;{&lt;BR /&gt;MCF_DTIM_DTER(0) = MCF_DTIM_DTER_REF | MCF_DTIM_DTER_CAP;&lt;BR /&gt;MCF_DTIM_DTMR(0) = 0&lt;BR /&gt;| MCF_DTIM_DTMR_PS(sys_clk_khz / 1000)&lt;BR /&gt;| MCF_DTIM_DTMR_ORRI&lt;BR /&gt;| MCF_DTIM_DTMR_FRR&lt;BR /&gt;| MCF_DTIM_DTMR_CLK_DIV1&lt;BR /&gt;| MCF_DTIM_DTMR_RST;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void my_pause(int usecs)&lt;BR /&gt;{&lt;BR /&gt;uint32 temp = 0;&lt;BR /&gt;&lt;BR /&gt;temp = MCF_DTIM0_DTCN;&lt;BR /&gt;&lt;BR /&gt;if((temp+usecs)&lt;BR /&gt;while(MCF_DTIM0_DTCN&amp;gt;(temp+usecs))&lt;BR /&gt;;&lt;BR /&gt;while(MCF_DTIM0_DTCN(temp+usecs))&lt;BR /&gt;;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and just call my_pause() to delay for a while!! seems to work pretty well!&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 16:22:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/pause-function-on-the-5213/m-p/135603#M1630</guid>
      <dc:creator>airswit</dc:creator>
      <dc:date>2006-11-17T16:22:28Z</dc:date>
    </item>
  </channel>
</rss>

