<?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: How to write 1 millisecond timer program for MC9S12ZI128 controller in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-write-1-millisecond-timer-program-for-MC9S12ZI128/m-p/1369248#M18283</link>
    <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/186056"&gt;@baji&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This is really an application issue.&lt;/P&gt;
&lt;P&gt;But I would scope the bus to see if a timing issue.&lt;/P&gt;
&lt;P&gt;Also, make sure the PT6 switches between Input and Output in time.&lt;/P&gt;
&lt;P&gt;You could use another output to signal the PT6 changes in the direction and scope it along with PTA6.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Nov 2021 11:04:34 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2021-11-10T11:04:34Z</dc:date>
    <item>
      <title>How to write 1 millisecond timer program for MC9S12ZI128 controller</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-write-1-millisecond-timer-program-for-MC9S12ZI128/m-p/1368232#M18277</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are using simulated GPIOs for one wire communication,&amp;nbsp;to interface&amp;nbsp;&lt;SPAN&gt;MC9S12ZI128 controller to humidity &amp;amp; temperature sensor (BM25S2021-1). But we are unable to read the status of sensor on GPIO pin. I think it is delay issue, please suggest whether it is correct or not. If i am wrong suggest me what is the exact problem.Here i am posting the code what i written.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;void delay(u16 count) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;int i;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;for(i=0;i&amp;lt;count;i++)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Nop();&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void One_wire_start()&lt;BR /&gt;{&lt;BR /&gt;DDRA=0x4E;&lt;BR /&gt;Clear();&lt;BR /&gt;delay(1565);&lt;BR /&gt;Set();&lt;BR /&gt;delay(43);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;u8 One_wire_ack(u8 *cnt)&lt;BR /&gt;{&lt;BR /&gt;u8 cnt;&lt;BR /&gt;DDRA=0x0E;&lt;BR /&gt;*cnt = _PTIA.Bits.PTIA6;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void Humidity(u8 *cnt)&lt;BR /&gt;{&lt;BR /&gt;u8 ow_op;&lt;BR /&gt;while(1)&lt;BR /&gt;{&lt;BR /&gt;One_wire_start();&lt;BR /&gt;One_wire_ack(cnt);&lt;BR /&gt;ow_op = OW_Read_Byte();&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void Set()&lt;BR /&gt;{&lt;BR /&gt;PTA_PTA6 = 0x01;&lt;BR /&gt;}&lt;BR /&gt;void Clear()&lt;BR /&gt;{&lt;BR /&gt;PTA_PTA6 = 0x00;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;char Poll_SO_OW()&lt;BR /&gt;{&lt;BR /&gt;unsigned char temp = 0;&lt;BR /&gt;Clear();&lt;BR /&gt;while (temp == 0x00) / waste time until not busy /&lt;BR /&gt;temp = ReadSO_OW();&lt;BR /&gt;Set();&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;char ReadSO_OW()&lt;BR /&gt;{&lt;BR /&gt;if (PTA &amp;amp; 0x1) return 1;&lt;BR /&gt;else return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;unsigned char OW_Get_Byte()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; unsigned char i = 0, in = 0, temp = 0;&lt;BR /&gt;&amp;nbsp; for (i = 0; i &amp;lt; 8; i++)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;in = (in &amp;lt;&amp;lt; 1); / shift 1 place to the left or shift in 0 /&lt;BR /&gt;&amp;nbsp; &amp;nbsp;temp = Poll_SO_OW(); / save input /&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (temp == 1) { / check to see if bit is high /&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;in = in | 0x01; / if high, make bit high /&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;BR /&gt;return in;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;unsigned char OW_Read_Byte()&lt;BR /&gt;{&lt;BR /&gt;unsigned char byte = 0;&lt;/P&gt;&lt;P&gt;Clear(); / enable device /&lt;BR /&gt;byte = OW_Get_Byte();&lt;BR /&gt;Set(); / disable device /&lt;BR /&gt;return byte; / return one byte read /&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 05:54:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-write-1-millisecond-timer-program-for-MC9S12ZI128/m-p/1368232#M18277</guid>
      <dc:creator>baji</dc:creator>
      <dc:date>2021-11-09T05:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to write 1 millisecond timer program for MC9S12ZI128 controller</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-write-1-millisecond-timer-program-for-MC9S12ZI128/m-p/1369248#M18283</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/186056"&gt;@baji&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This is really an application issue.&lt;/P&gt;
&lt;P&gt;But I would scope the bus to see if a timing issue.&lt;/P&gt;
&lt;P&gt;Also, make sure the PT6 switches between Input and Output in time.&lt;/P&gt;
&lt;P&gt;You could use another output to signal the PT6 changes in the direction and scope it along with PTA6.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 11:04:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-write-1-millisecond-timer-program-for-MC9S12ZI128/m-p/1369248#M18283</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2021-11-10T11:04:34Z</dc:date>
    </item>
  </channel>
</rss>

