<?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 Interfacing two HC08's with SCI in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interfacing-two-HC08-s-with-SCI/m-p/193489#M15069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey chums,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I've got HC08's i plan on hooking up to a TLP/RLP434a pair and making a remote control car out of it. I'm essentialy done with the hardware but I'm having trouble programming the SCI interface. To test the code i've just been using a wire from the Tx on the master HC08 to the RX on the slave HC08, from what I gather from CodeWarrior (when the pair isn't attached) the master is properly transmitting and the reciever is waiting for the Recieve Data Full flag to go high. Unfortunately when i have the whole setup attached CodeWarrior spits a "Trigger A&amp;amp;B" error at me, after disabling triggers I instead get a "invalid BP" error. That engineering 6th sense we all have tells me to look at the interrupt routine, but I'm teaching myself this whole SCI interface dealy so I could be way off base here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TL;DR: Would you kindly peruse my SCI interface code and point out any flaws you see? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attachments:&amp;nbsp; TxRx.zip contains the following files:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; master.c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //the master control file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_SCI_master.c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //included by master.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; slave.c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //the slave ontrol file&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_SCI_slave.c &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //included by slave.c, contains interrupt routine responsible for recieving data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jan 2012 06:19:05 GMT</pubDate>
    <dc:creator>kraete</dc:creator>
    <dc:date>2012-01-02T06:19:05Z</dc:date>
    <item>
      <title>Interfacing two HC08's with SCI</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interfacing-two-HC08-s-with-SCI/m-p/193489#M15069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey chums,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I've got HC08's i plan on hooking up to a TLP/RLP434a pair and making a remote control car out of it. I'm essentialy done with the hardware but I'm having trouble programming the SCI interface. To test the code i've just been using a wire from the Tx on the master HC08 to the RX on the slave HC08, from what I gather from CodeWarrior (when the pair isn't attached) the master is properly transmitting and the reciever is waiting for the Recieve Data Full flag to go high. Unfortunately when i have the whole setup attached CodeWarrior spits a "Trigger A&amp;amp;B" error at me, after disabling triggers I instead get a "invalid BP" error. That engineering 6th sense we all have tells me to look at the interrupt routine, but I'm teaching myself this whole SCI interface dealy so I could be way off base here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TL;DR: Would you kindly peruse my SCI interface code and point out any flaws you see? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attachments:&amp;nbsp; TxRx.zip contains the following files:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; master.c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //the master control file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_SCI_master.c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //included by master.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; slave.c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //the slave ontrol file&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_SCI_slave.c &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //included by slave.c, contains interrupt routine responsible for recieving data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2012 06:19:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interfacing-two-HC08-s-with-SCI/m-p/193489#M15069</guid>
      <dc:creator>kraete</dc:creator>
      <dc:date>2012-01-02T06:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Interfacing two HC08's with SCI</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interfacing-two-HC08-s-with-SCI/m-p/193490#M15070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, and welcome to the forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I do not think that you are "done with the hardware".&amp;nbsp; These very cheap, low power transmitter and receiver modules that use OOK modulation are not suitable for direct use with the SCI module, and its NRZ operation.&amp;nbsp; To provide a consistent operating threshold for "slicing" the data output requires that the modulation method provides at least one on-off&amp;nbsp;transition for each data bit.&amp;nbsp; This does not occur for the SCI output, where the number of transitions within a byte will widely vary, depending on the data being sent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A further issue may be the presence of noise at the receiver output in the absence of a signal.&amp;nbsp; Your decoding solution must discriminate this noise by virtue of its random timing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For OOK operation, you might utilize a phase encoded modulation&amp;nbsp;method, such as Manchester coding, or use a PWM method.&amp;nbsp; Because of the very low transmitter power levels of a few milliwatts, the range will be limited to perhaps 15-25 metres only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error detection is typically provided by transmitting each data sequence multiple times, with a successful decode when the same sequence is received two or three times in succession.&amp;nbsp; The data sequence would probably not exceed 32 bits in length.&amp;nbsp; This approach is therefore not suited to a continuous data stream, but is intended&amp;nbsp;for very simple control applications.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the presence of random noise fluctuations from the receiver, the code must test the timing of each transition to determine the start of the data.&amp;nbsp; This may mean that the MCU is "very busy", even when there is no signal.&amp;nbsp; For some applications, this may be unacceptable for the main MCU, and in such cases a separate MCU would handle the decoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps you should utilize alternative transmitter and receiver modules that internally encode and decode the data,&amp;nbsp;provide for error detection/correction, and&amp;nbsp;use a SCI interface to the MCU.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As least part of your coding issues appear to be that the main&amp;nbsp;function for the slave may potentially exit.&amp;nbsp; This is not allowable.&amp;nbsp; Another possibility is that you have a COP timeout reset.&amp;nbsp; The cause of each reset may be determined from the SRS register.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 02:12:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interfacing-two-HC08-s-with-SCI/m-p/193490#M15070</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2012-01-04T02:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Interfacing two HC08's with SCI</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interfacing-two-HC08-s-with-SCI/m-p/193491#M15071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you happen to know of any good transmitters that would work better with my project? I was recommended this one by why electronics professor i assumed it would work im kinda bummed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 06:43:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interfacing-two-HC08-s-with-SCI/m-p/193491#M15071</guid>
      <dc:creator>kraete</dc:creator>
      <dc:date>2012-01-04T06:43:55Z</dc:date>
    </item>
  </channel>
</rss>

