<?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>8-bit MicrocontrollersのトピックRe: New and Confused about HCS08 Timers.  Please Help...</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143142#M6511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Evan,&lt;BR /&gt;Thanks very much. This looks clean and simple. I assume I have to add the UART_TIMER_ISR to the vectors.c in the interrupt position 5. Do I need any code to initialize or enable this interrupt? How would I disable this interrupt?&lt;BR /&gt;Thanks again and best regards,&lt;BR /&gt;Jason&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Jan 2007 14:59:23 GMT</pubDate>
    <dc:creator>Jporter</dc:creator>
    <dc:date>2007-01-19T14:59:23Z</dc:date>
    <item>
      <title>New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143136#M6505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am reading data from serial port. I would like to time out and reset my pointers, etc. if I don't receive a character in 1ms. On other microcontrollers I use a timer/counter with an overflow interrupt. Every time i receive a character I reset the counter which delays the overflow interrupt. However if I get an overflow interrupt then I know I have timed out and I can reset my buffer. This is very basic and supported by almost all controllers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to HCS08 and it seems that the timers have a steep learning curve. So I started with processor expert to get a sample code I can start from. There are so many options for timers and counters but none of them offer the choices of overflow interrupt and reset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using a GT60 HCS08 with 16Mhz clock and also using SMAC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would greatly appreciate anyone pointing me to some code snippet or processor expert bean choices that shows me how to do this on the HCS08.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jason&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 12:13:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143136#M6505</guid>
      <dc:creator>Jporter</dc:creator>
      <dc:date>2007-01-18T12:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143137#M6506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Jason,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Your timing is probably most easily handled using one of the timer channels set up for output compare mode (interrupt only - with no pin output required).&amp;nbsp; Make sure the timer prescale value is set so that the timer overflow period is more than 1 ms.&amp;nbsp; You will also need to calculate how many timer clock periods represent&amp;nbsp; the 1 ms period.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;After receiving each serial character -&lt;/FONT&gt;&lt;/DIV&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Read the value in the timer counter register.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Add to this the number of timer clock periods for 1ms delay - don't worry about any overflow in the calculation.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Write&amp;nbsp;this new word value&amp;nbsp;to the timer channel register (of the channel you are using).&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Clear the timer channel flag.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Enable the timer&amp;nbsp;interrupt for the channel.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Should you then get a timer channel interrupt, the ISR for the channel should -&lt;/FONT&gt;&lt;/DIV&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Clear your pointers, buffers, etc.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Disable further timer channel interrupts.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The timer is continuously incrementing during this process - it is not necessary to ever stop or reset the timer.&amp;nbsp; The timer overflow interrupt is not used.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 13:36:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143137#M6506</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-01-18T13:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143138#M6507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Mac,&lt;BR /&gt;Thank you very much for your post. This sounds like it would work exactly for what I need. I am, however, very new to HC08 and very intimidated by hundreds of pages of documentation on the processor and the TPU. I would be very grateful if you can point me to some example code that shows me how to set various registers and prescalar values. I am ready to give up on Processor Expert on which I have spent many hours. So at this stage a sample timer code or tutorial in conjunction with your suggestions in your post will give me jump start I need.&lt;BR /&gt;Thanks again,&lt;BR /&gt;Jason&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 14:04:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143138#M6507</guid>
      <dc:creator>Jporter</dc:creator>
      <dc:date>2007-01-18T14:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143139#M6508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Dear Customer,&lt;/DIV&gt;&lt;DIV&gt;In your case it is suitable and easy solution to use the TimerInt bean. Set 1ms for timer channel. After receiving character you can disable and enable this bean by its methods that causes reset counter and delays the overflow interrupt as you need.&lt;/DIV&gt;&lt;DIV&gt;I hope this help you.&lt;/DIV&gt;&lt;DIV&gt;Best Regards,&lt;/DIV&gt;&lt;DIV&gt;Jan Pospisilik, Processor Expert Support&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2007 20:50:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143139#M6508</guid>
      <dc:creator>ProcessorExpert</dc:creator>
      <dc:date>2007-01-18T20:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143140#M6509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;There's a timer in file&amp;nbsp;"uart.c"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;add the following code into fuction "void SCI_Init(void){}"&lt;/DIV&gt;&lt;DIV&gt;void SCI_Init(void)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;//other code.....&lt;/DIV&gt;&lt;DIV&gt;TPM1SC = 0x48;&lt;/DIV&gt;&lt;DIV&gt;TPM1MODH = ox3E; //0x3E80 means the 16MHz system will enter isr every 1ms&lt;/DIV&gt;&lt;DIV&gt;TPM1MODL = ox80;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;//here is the isr&lt;/DIV&gt;&lt;DIV&gt;interrupt void UART_TIMER_ISR(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;TPM1SC &amp;amp;= 0x7F; // Read, Clear bit 7, Write&lt;BR /&gt;&amp;nbsp;UartRxTimer++;&amp;nbsp; // &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;generalTimer++; //&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;//the system will be entered every 1ms, just add your own code here.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;//......&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;here's my mail: &lt;A href="mailto:yanzexuan@gmail.com" rel="nofollow" target="_blank"&gt;yanzexuan@gmail.com&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;because it's a bad network as I'm in china&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Evan&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jan 2007 14:21:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143140#M6509</guid>
      <dc:creator>EvanYin</dc:creator>
      <dc:date>2007-01-19T14:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143141#M6510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Jan,&lt;BR /&gt;This was a great suggestion as I managed to get the interrupt working with processor expert. However I am having a hell of a time just cutting the interrupt portion and pasting it to my working code which was originally derived from the BeeKit. I think I am getting close but there are still many processor expert macros that I have to get rid of tp have a clean compile.&lt;BR /&gt;Jason&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jan 2007 14:33:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143141#M6510</guid>
      <dc:creator>Jporter</dc:creator>
      <dc:date>2007-01-19T14:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143142#M6511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Evan,&lt;BR /&gt;Thanks very much. This looks clean and simple. I assume I have to add the UART_TIMER_ISR to the vectors.c in the interrupt position 5. Do I need any code to initialize or enable this interrupt? How would I disable this interrupt?&lt;BR /&gt;Thanks again and best regards,&lt;BR /&gt;Jason&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jan 2007 14:59:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143142#M6511</guid>
      <dc:creator>Jporter</dc:creator>
      <dc:date>2007-01-19T14:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143143#M6512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Jporter&lt;BR /&gt;&lt;BR /&gt;You can also have a look at EBS08, where i use the TIM for generating the TIC's (with the MOD register or as Output capture). IF you want i have also modules for the SCI (for command lines delimited ie. LF and with a ring-buffer).&lt;BR /&gt;&lt;BR /&gt;Saluti Joerg&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jan 2007 17:03:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143143#M6512</guid>
      <dc:creator>joerg</dc:creator>
      <dc:date>2007-01-19T17:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143144#M6513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, Jason:&lt;BR /&gt;&lt;BR /&gt;Do you need a timer at all? Will "Idle-line detect" do the job?&lt;BR /&gt;&lt;BR /&gt;You did not mention what baud rate you are using, but 1 millisecond is about one character time at 9600 baud.&lt;BR /&gt;&lt;BR /&gt;If your purpose is to detect when the other end of the line has finished transmitting, the SCI may be able to do that for you. The Idle-line detect feature in the SCI can give you an interrupt when the line has been idle for one whole character period. No timer necessary.&lt;BR /&gt;&lt;BR /&gt;It is one of the reasons that the manual is so darn big . . . &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2007 08:24:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143144#M6513</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2007-01-22T08:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: New and Confused about HCS08 Timers.  Please Help...</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143145#M6514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Rocco,&lt;BR /&gt;Thanks for your post. I actually got the overflow interrupt working.&lt;BR /&gt;I actually reset the counter every time character so the only time I get an overflow interrupt is when the stream is completed.&lt;BR /&gt;However, I was not aware of the idle-line interrupt as it appears to be a cooler way of doing it.&lt;BR /&gt;Something to try next time.&lt;BR /&gt;Thanks again,&lt;BR /&gt;Jason&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2007 09:17:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/New-and-Confused-about-HCS08-Timers-Please-Help/m-p/143145#M6514</guid>
      <dc:creator>Jporter</dc:creator>
      <dc:date>2007-01-22T09:17:28Z</dc:date>
    </item>
  </channel>
</rss>

