<?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 Not receiving data through SCI in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135425#M2266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;#include &amp;lt;hcs12dp256.h&amp;gt;#define RDRF 0x20&amp;nbsp;&amp;nbsp; // Receive Data Register Full Bit#define TDRE 0x80&amp;nbsp;&amp;nbsp; // Transmit Data Register Empty Bitvoid init_SCI1(void){&amp;nbsp; SCI1BDH = 0;&amp;nbsp; SCI1BDL = 156; // baud rate to 9600&amp;nbsp; SCI1CR1 = 0x20; // 8-N-1&amp;nbsp; SCI1CR2 = 0x0C;}void init_PB(void) // Setup LEDs for data verification{&amp;nbsp;&amp;nbsp; DDRB=0xFF;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Output - Port B (Specifies Direction)&amp;nbsp; PORTB=0x01;&amp;nbsp;&amp;nbsp; // Enable Port B0&amp;nbsp; DDRH|=0x00;&amp;nbsp;&amp;nbsp; // Input - Port H - Direction of Switches&amp;nbsp; DDRJ|=0x02;&amp;nbsp;&amp;nbsp; // Output - PJ1 - Sets an output on Pin 2&amp;nbsp; PTJ&amp;amp;=0xFD;&amp;nbsp;&amp;nbsp;&amp;nbsp; // LED Enable - Forces 0 to Pin 2}main(void){&amp;nbsp; init_PB();&amp;nbsp; PTJ &amp;amp;= 0xFE;&amp;nbsp; init_SCI1();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; while((RDRF &amp;amp; SCI1SR1)== 0){}; // RDRF never goes high ???&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTB = SCI1SR1;&amp;nbsp; // Trying to display the output on LEDs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/PRE&gt;&lt;BR /&gt;I'm using a mc9s12dp256 on a Dragon 12 board.&amp;nbsp; This is my code for the receiver.&amp;nbsp; It's just quick and dirty just to receive some data.&amp;nbsp; This is my first attempt at SCI communication.&amp;nbsp; I have verified that the transmitter is sending 10 bits of data (start,data,stop).&amp;nbsp; It is running through the rs485 in single-line mode.&amp;nbsp; The RDRF bit never shows that the SCI1DRL register is full.&amp;nbsp; Any insight would be super helpful.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Aaron W.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jun 2007 02:09:00 GMT</pubDate>
    <dc:creator>Tineras</dc:creator>
    <dc:date>2007-06-01T02:09:00Z</dc:date>
    <item>
      <title>Not receiving data through SCI</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135425#M2266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;#include &amp;lt;hcs12dp256.h&amp;gt;#define RDRF 0x20&amp;nbsp;&amp;nbsp; // Receive Data Register Full Bit#define TDRE 0x80&amp;nbsp;&amp;nbsp; // Transmit Data Register Empty Bitvoid init_SCI1(void){&amp;nbsp; SCI1BDH = 0;&amp;nbsp; SCI1BDL = 156; // baud rate to 9600&amp;nbsp; SCI1CR1 = 0x20; // 8-N-1&amp;nbsp; SCI1CR2 = 0x0C;}void init_PB(void) // Setup LEDs for data verification{&amp;nbsp;&amp;nbsp; DDRB=0xFF;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Output - Port B (Specifies Direction)&amp;nbsp; PORTB=0x01;&amp;nbsp;&amp;nbsp; // Enable Port B0&amp;nbsp; DDRH|=0x00;&amp;nbsp;&amp;nbsp; // Input - Port H - Direction of Switches&amp;nbsp; DDRJ|=0x02;&amp;nbsp;&amp;nbsp; // Output - PJ1 - Sets an output on Pin 2&amp;nbsp; PTJ&amp;amp;=0xFD;&amp;nbsp;&amp;nbsp;&amp;nbsp; // LED Enable - Forces 0 to Pin 2}main(void){&amp;nbsp; init_PB();&amp;nbsp; PTJ &amp;amp;= 0xFE;&amp;nbsp; init_SCI1();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; while((RDRF &amp;amp; SCI1SR1)== 0){}; // RDRF never goes high ???&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTB = SCI1SR1;&amp;nbsp; // Trying to display the output on LEDs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/PRE&gt;&lt;BR /&gt;I'm using a mc9s12dp256 on a Dragon 12 board.&amp;nbsp; This is my code for the receiver.&amp;nbsp; It's just quick and dirty just to receive some data.&amp;nbsp; This is my first attempt at SCI communication.&amp;nbsp; I have verified that the transmitter is sending 10 bits of data (start,data,stop).&amp;nbsp; It is running through the rs485 in single-line mode.&amp;nbsp; The RDRF bit never shows that the SCI1DRL register is full.&amp;nbsp; Any insight would be super helpful.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Aaron W.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2007 02:09:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135425#M2266</guid>
      <dc:creator>Tineras</dc:creator>
      <dc:date>2007-06-01T02:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Not receiving data through SCI</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135426#M2267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Aaron,&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;It is not clear from your code snippet, the manner in which you control the RS485 interface device.&amp;nbsp; I am not familiar with your Dragon 12 board.&amp;nbsp; However, for the MCU to receive data, the transmit section of the interface must be disabled, and the receive section enabled, otherwise the SCI won't see any incoming data.&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;It may be useful to check for the presence of data, using an oscilloscope, on each line of the RS485 pair, and at the RXD pin of the MCU.&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;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2007 22:43:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135426#M2267</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-06-01T22:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Not receiving data through SCI</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135427#M2268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I have confirmed the following through RS232 via serial cable:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;-Transmitter-&lt;/DIV&gt;&lt;DIV&gt;Checked output on oscope&lt;/DIV&gt;&lt;DIV&gt;Received char from transmitter in hyperterminal&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;-Receiver-&lt;/DIV&gt;&lt;DIV&gt;Sent char to receiver from hyperterminal&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have also tried to connect the TxD and RxD directly on the chips with no luck.&amp;nbsp; Both boards are have a common ground.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm working on making a male to male serial cable right now to check rs232 connection from board to board.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2007 23:53:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135427#M2268</guid>
      <dc:creator>Tineras</dc:creator>
      <dc:date>2007-06-01T23:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Not receiving data through SCI</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135428#M2269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I managed to get data to the receiver directly by switching the communications jumper to urxd1 on both boards.&amp;nbsp; I'm still not sure why it won't work through the rs485, but I'm working on it.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jun 2007 00:33:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135428#M2269</guid>
      <dc:creator>Tineras</dc:creator>
      <dc:date>2007-06-02T00:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Not receiving data through SCI</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135429#M2270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&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;I am somewhat confused!&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;Initially you referred to RS485 interface, but now you refer to RS232.&amp;nbsp; Different drivers, and different voltage levels apply in each case.&amp;nbsp; Are you using a RS232-to-RS485 adaptor with the PC on which you run hyperterminal?&amp;nbsp; What device&amp;nbsp;type is used for the RS485 interface on the Dragon 12 board?&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;Since RS485 (on a single pair) is half duplex, your SCI code will need to control the direction in which the RS485 interface operates.&amp;nbsp; This is not a requirement for RS232 operation.&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;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jun 2007 00:43:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135429#M2270</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-06-02T00:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Not receiving data through SCI</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135430#M2271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I was just switching to the RS232 to verify that communication was at least happening.&amp;nbsp; Anyway, I figured it out.&amp;nbsp; I had not set the DDRJ register correctly.&amp;nbsp; Once I changed J0 to outputs, it worked perfectly.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jun 2007 05:31:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-receiving-data-through-SCI/m-p/135430#M2271</guid>
      <dc:creator>Tineras</dc:creator>
      <dc:date>2007-06-02T05:31:11Z</dc:date>
    </item>
  </channel>
</rss>

