<?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: MC68HC908QT4 in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QT4/m-p/2065715#M24133</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/248065"&gt;@wazi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Checking at your TIM initialization I can give you the following feedback:&lt;/P&gt;
&lt;P&gt;By setting the value of TSC by 0x04 you will have the following configuration&lt;/P&gt;
&lt;P&gt;TOF=0; TOIE=0; TSTOP=0; TRST=0; PS2=1; PS1=0; PS0=0;&lt;/P&gt;
&lt;P&gt;If what you are looking is for TSTOP be set, the value charge on TSC should be 0x20&lt;/P&gt;
&lt;P&gt;Also, for the rising edge capture setting I recommend you check Table 14-3. Mode, Edge, and Level Selection of datasheet.&lt;/P&gt;
&lt;P&gt;Even though we do not have and specific example code for this configuration you can take as reference the following document, where it explains furthermore TIM module on HC08.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN2784.pdf" target="_blank"&gt;AN2784.fm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Mar 2025 16:50:33 GMT</pubDate>
    <dc:creator>Pablo_Ramos</dc:creator>
    <dc:date>2025-03-20T16:50:33Z</dc:date>
    <item>
      <title>MC68HC908QT4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QT4/m-p/2061889#M24130</link>
      <description>&lt;P&gt;how mc68hc908qt4 handles the interrupt.&lt;BR /&gt;I used it to receive PWM signals from the TCS3200 sensor How to do that?&lt;BR /&gt;I tried to do some on my own, but seemed to go in without interruption&lt;/P&gt;&lt;P&gt;/* Global Variables */&lt;BR /&gt;volatile unsigned int edge_count = 0; // Rising edge counter&lt;BR /&gt;volatile unsigned int total_edges = 0; // Edges in 10ms window&lt;/P&gt;&lt;P&gt;/* TIM Initialization */&lt;BR /&gt;void TIM_Config(void)&lt;BR /&gt;{&lt;BR /&gt;// 1. Stop and reset TIM&lt;BR /&gt;TSC = 0x04; // TSTOP=1 (Stop counter), TRST=1 (Reset counter)&lt;/P&gt;&lt;P&gt;// 2. Configure prescaler and modulo for 3.2MHz clock&lt;BR /&gt;TSC_PS2 = 0; // PS[2:0]=011 (Prescaler &lt;LI-EMOJI id="lia_smiling-face-with-sunglasses" title=":smiling_face_with_sunglasses:"&gt;&lt;/LI-EMOJI&gt;&lt;BR /&gt;TSC_PS1 = 1;&lt;BR /&gt;TSC_PS0 = 1; // TIM clock = 3.2MHz/8 = 400kHz (2.5μs period)&lt;/P&gt;&lt;P&gt;TMODH = 0x0F; // Modulo value = 4000 (400kHz * 0.01s = 4000 cycles)&lt;BR /&gt;TMODL = 0xA0; // 0x0FA0 = 4000&lt;/P&gt;&lt;P&gt;// 3. Configure Channel 0 for rising edge capture&lt;BR /&gt;TSC0 = 0x00; // Clear configuration&lt;BR /&gt;TSC0_ELS0A = 0; // ELS0B:ELS0A=00 (Capture rising edge)&lt;BR /&gt;TSC0_ELS0B = 0;&lt;/P&gt;&lt;P&gt;// 4. Start TIM counter&lt;BR /&gt;TSC_TSTOP = 0; // Enable counting&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Main Function */&lt;BR /&gt;void main(void)&lt;BR /&gt;{&lt;BR /&gt;TIM_Config();&lt;/P&gt;&lt;P&gt;while(1)&lt;BR /&gt;{&lt;BR /&gt;// Detect input capture events&lt;BR /&gt;if(TSC0_CH0F)&lt;BR /&gt;{&lt;BR /&gt;edge_count++; // Increment edge counter&lt;BR /&gt;TCH0L; // Dummy read to clear capture flag&lt;BR /&gt;TSC0_CH0F = 0; // Clear channel flag&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Handle 10ms overflow&lt;BR /&gt;if(TSC_TOF)&lt;BR /&gt;{&lt;BR /&gt;total_edges = edge_count; // Save result&lt;BR /&gt;edge_count = 0; // Reset counter&lt;BR /&gt;TSC_TOF = 0; // Clear overflow flag&lt;/P&gt;&lt;P&gt;// Frequency = total_edges / 0.01s = total_edges * 100 (Hz)&lt;BR /&gt;// Add your frequency calculation/display logic here&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;That's my program，If you have a timer or input capture about this chip.Can give me a reference? THINK YOU.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 07:55:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QT4/m-p/2061889#M24130</guid>
      <dc:creator>wazi</dc:creator>
      <dc:date>2025-03-14T07:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: MC68HC908QT4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QT4/m-p/2065715#M24133</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/248065"&gt;@wazi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Checking at your TIM initialization I can give you the following feedback:&lt;/P&gt;
&lt;P&gt;By setting the value of TSC by 0x04 you will have the following configuration&lt;/P&gt;
&lt;P&gt;TOF=0; TOIE=0; TSTOP=0; TRST=0; PS2=1; PS1=0; PS0=0;&lt;/P&gt;
&lt;P&gt;If what you are looking is for TSTOP be set, the value charge on TSC should be 0x20&lt;/P&gt;
&lt;P&gt;Also, for the rising edge capture setting I recommend you check Table 14-3. Mode, Edge, and Level Selection of datasheet.&lt;/P&gt;
&lt;P&gt;Even though we do not have and specific example code for this configuration you can take as reference the following document, where it explains furthermore TIM module on HC08.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN2784.pdf" target="_blank"&gt;AN2784.fm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 16:50:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QT4/m-p/2065715#M24133</guid>
      <dc:creator>Pablo_Ramos</dc:creator>
      <dc:date>2025-03-20T16:50:33Z</dc:date>
    </item>
  </channel>
</rss>

