<?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 MCF52235 and KS0108 LCD´s in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-and-KS0108-LCD-s/m-p/150625#M3857</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&amp;nbsp;Hi friends&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;I´m trying to do a very cheap bidirectional interface between MCF52235 and&amp;nbsp; a 128x64 LCD controlled by KS0108 (most common and cheap dot matrix LCD).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Unfortunately, this display requires 5V supply, and i think coldfire is NOT 5V tolerant.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;On another thread on this forum i´ve read that we can connect CF´s gpio as inputs to a TTL level device, since CF will clamp the high level voltage to 3.6V. All we need to do is limit the current by using resistors ( I tried from 1K to 10 K values).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Well, i used the PORTAN (full 8 bit registers) to do the D0~D7 lines. Using it as output, i can succefully write to display and show any kind of message and chars on it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;The problem happens when i try to read the device´s ram. Read the internal LCD ram is needed because when you want to set/clear just one pixel, you need to know the state of the other pixels (one pixel is one bit but we write in bytes, so 8 pixels per write), to avoid clearing preivous set pixels.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;So, using PORTAN as input, i can´t read correctly. I mean, when i change the PORTAN DDR register to 0x00 (turn all pins as input), the SETAN register goes to 0xFE, no matter what level i have on port´s pins.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Testing the PORTAN as gpio input without the display, i can succefully read the pins state correctly (0x00 with port´s pins to GND and 0xFF with port´s pins to 3V3), so this port is working OK.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Does somebody has done something similar, or guess what i´m missing here?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Thank you all for the help&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Regards&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Sep 2007 19:06:28 GMT</pubDate>
    <dc:creator>Kremer</dc:creator>
    <dc:date>2007-09-27T19:06:28Z</dc:date>
    <item>
      <title>MCF52235 and KS0108 LCD´s</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-and-KS0108-LCD-s/m-p/150625#M3857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&amp;nbsp;Hi friends&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;I´m trying to do a very cheap bidirectional interface between MCF52235 and&amp;nbsp; a 128x64 LCD controlled by KS0108 (most common and cheap dot matrix LCD).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Unfortunately, this display requires 5V supply, and i think coldfire is NOT 5V tolerant.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;On another thread on this forum i´ve read that we can connect CF´s gpio as inputs to a TTL level device, since CF will clamp the high level voltage to 3.6V. All we need to do is limit the current by using resistors ( I tried from 1K to 10 K values).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Well, i used the PORTAN (full 8 bit registers) to do the D0~D7 lines. Using it as output, i can succefully write to display and show any kind of message and chars on it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;The problem happens when i try to read the device´s ram. Read the internal LCD ram is needed because when you want to set/clear just one pixel, you need to know the state of the other pixels (one pixel is one bit but we write in bytes, so 8 pixels per write), to avoid clearing preivous set pixels.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;So, using PORTAN as input, i can´t read correctly. I mean, when i change the PORTAN DDR register to 0x00 (turn all pins as input), the SETAN register goes to 0xFE, no matter what level i have on port´s pins.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Testing the PORTAN as gpio input without the display, i can succefully read the pins state correctly (0x00 with port´s pins to GND and 0xFF with port´s pins to 3V3), so this port is working OK.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Does somebody has done something similar, or guess what i´m missing here?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Thank you all for the help&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Regards&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 19:06:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-and-KS0108-LCD-s/m-p/150625#M3857</guid>
      <dc:creator>Kremer</dc:creator>
      <dc:date>2007-09-27T19:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52235 and KS0108 LCD´s</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-and-KS0108-LCD-s/m-p/150626#M3858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&amp;nbsp;Oh, i forgot to put my read routine:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;/*-------------------------------------------------------------------------------Read data from LCD U8 = LcdDataRead();-------------------------------------------------------------------------------*/U8 LcdDataRead (){ unsigned char rdata;  /* Data Mode */ LCD_CTRL_WR |=  LCD_DI; /* Read Mode */ LCD_CTRL_WR |= LCD_RW;   /* Configura porta AN de dados como entrada */ LCD_DATA_DDR = 0x00; /* 2 clock pulses is needed to read data ram */ glcd_StrobeEnable(); // shift LCD data to output register glcd_StrobeEnable(); // shift data to KS0108 pins, rdata= (U8)(LCD_DATA_RD);/* Nivel 0 em todos os pinos da porta TA */ LCD_CS_WR  = 0x00; /* Configura porta AN de dados como saida */ LCD_DATA_DDR = 0xFF; return rdata; /* return the data read */}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Regards&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:53:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-and-KS0108-LCD-s/m-p/150626#M3858</guid>
      <dc:creator>Kremer</dc:creator>
      <dc:date>2020-10-29T08:53:26Z</dc:date>
    </item>
  </channel>
</rss>

