<?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>S12 / MagniV Microcontrollers中的主题 External RAM Write and Read S12XE</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/External-RAM-Write-and-Read-S12XE/m-p/506388#M12372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the S12XE and LY62W102516 1024K X 16 BIT LOW POWER CMOS SRAM.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I write to the external SRAM and then read back the data, I do not get correct values.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of write and read.&lt;/P&gt;&lt;P&gt;24 24 24 24 24 24 24 24 24 24&amp;nbsp; // Write&lt;/P&gt;&lt;P&gt;00 20 24 24 24 24 24 24 24 24&amp;nbsp; // Read&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the related code.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define&amp;nbsp; WRITE_BYTE_B(a,d)&amp;nbsp; *((unsigned char *far)(a+0x200000UL))=d&lt;/P&gt;&lt;P&gt;#define&amp;nbsp; READ_BYTE_B(a)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *((unsigned char *far)(a+0x200000UL))&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t readStr[16];&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(addr = 0; addr &amp;lt; 10; addr++) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WRITE_BYTE_B(addr,0x24);&amp;nbsp; // write RAM address&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(addr = 0; addr &amp;lt; 10; addr++) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; readStr[addr] = READ_BYTE_B(addr);&amp;nbsp; // read RAM address&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Dec 2015 23:39:18 GMT</pubDate>
    <dc:creator>rayhall</dc:creator>
    <dc:date>2015-12-25T23:39:18Z</dc:date>
    <item>
      <title>External RAM Write and Read S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/External-RAM-Write-and-Read-S12XE/m-p/506388#M12372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the S12XE and LY62W102516 1024K X 16 BIT LOW POWER CMOS SRAM.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I write to the external SRAM and then read back the data, I do not get correct values.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of write and read.&lt;/P&gt;&lt;P&gt;24 24 24 24 24 24 24 24 24 24&amp;nbsp; // Write&lt;/P&gt;&lt;P&gt;00 20 24 24 24 24 24 24 24 24&amp;nbsp; // Read&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the related code.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define&amp;nbsp; WRITE_BYTE_B(a,d)&amp;nbsp; *((unsigned char *far)(a+0x200000UL))=d&lt;/P&gt;&lt;P&gt;#define&amp;nbsp; READ_BYTE_B(a)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *((unsigned char *far)(a+0x200000UL))&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t readStr[16];&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(addr = 0; addr &amp;lt; 10; addr++) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WRITE_BYTE_B(addr,0x24);&amp;nbsp; // write RAM address&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(addr = 0; addr &amp;lt; 10; addr++) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; readStr[addr] = READ_BYTE_B(addr);&amp;nbsp; // read RAM address&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Dec 2015 23:39:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/External-RAM-Write-and-Read-S12XE/m-p/506388#M12372</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2015-12-25T23:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: External RAM Write and Read S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/External-RAM-Write-and-Read-S12XE/m-p/506389#M12373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ray,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Unfortunately I am not sure what could be reason for that behavior.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Problem could be in connection of address bits or some timing issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Please look at attached draft of document with external bus examples.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;In case of MEBI module at S12XE, the data bus is always 16 bit. Please check how you connected A0 pin in SRAM memory.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Example code use MRAM with 35ns read and write cycle. Your SRAM may have 55 or 70ns read/write cycle. In that case some wait states may be necessary for fastest MCU bus clock (50MHz). See chapter 5.4.4 Stretched External Bus Accesses in RM for more details. You may also try temporarily decrease bus clock for testing whether it could be the root cause. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 00:11:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/External-RAM-Write-and-Read-S12XE/m-p/506389#M12373</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-12-30T00:11:58Z</dc:date>
    </item>
  </channel>
</rss>

