<?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のトピックSPI to HC595 and LCD</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-to-HC595-and-LCD/m-p/128953#M1023</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Hi All,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am attempting to output some measured values of frequency and power factor to an LCD module. I am using a 68hc12c32 with codewarrior, programming in C. I am using SPI to transmit the data (PORT M) and 2 general purpose channels (PORT T) for enable and reset bits. I am trying to shift the data through a hc595 serial to parallel shift register.&lt;/DIV&gt;&lt;DIV&gt;I think I may have set up the SPI incorrectly as it does not seem to be operating at all. I am relatively new to both microcontrollers and 'C' programming so have probably made an error somewhere. I have included the code any ideas would be greatly appreciated.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Martin&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/*----Code---*/&lt;/DIV&gt;&lt;DIV&gt;#define Slave_Off 0x8&amp;nbsp;//For setting SS bit&lt;BR /&gt;#define CMD 0&amp;nbsp;&amp;nbsp;// For command mode RST-low, EN-high&lt;BR /&gt;#define DISP 1&amp;nbsp; // For display mode RST-high, EN-high&lt;BR /&gt;#define LO 0x0 // Set all Enable and Reset bits low&lt;BR /&gt;#define EN 0x4 // Set Enable bit High&lt;BR /&gt;#define RST 0x8 // Set reset bit high&lt;BR /&gt;#define EN_RST 0xC // Set Enable and Reset bits high&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;/*--- Port direction and SPI setup ---*/&lt;/DIV&gt;&lt;DIV&gt;void SPI_Set(void){&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;DDRM = 0x38; // Set PortM as output&lt;BR /&gt;&amp;nbsp;DDRT = 0xC;&amp;nbsp; // Set PortT as output&lt;BR /&gt;&amp;nbsp;SPICR1 = 0x52; // Set SPI control register 1&lt;BR /&gt;&amp;nbsp;SPICR2 = 0x10; // Set SPI control register 2&lt;BR /&gt;&amp;nbsp;PTT = 0; // LCD command mode no operation&lt;BR /&gt;&amp;nbsp;PTM = Slave_Off; // hc595 not listening&lt;BR /&gt;}&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/*--- Delay Code ---*/&lt;BR /&gt;/*--- Needs to be configured to Bus clock, Boot 24Mhz, Run 4Mhz ---*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;void Delay(unsigned int sec){&lt;BR /&gt;&amp;nbsp;unsigned int i, j;&lt;BR /&gt;&amp;nbsp;for(i = 0; i &amp;lt; sec; i++){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(j = 0; j &amp;lt; 1000; j++){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;}&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/*-- Routine to send command or character to display --*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;void set_lcd(char n, char reg){&lt;BR /&gt;&amp;nbsp;char c;&lt;/DIV&gt;&lt;DIV&gt;/* First send the byte to the HC595 */&lt;BR /&gt;&amp;nbsp;PTM &amp;amp;= ~Slave_Off; // Listen up, slave&lt;BR /&gt;&amp;nbsp;SPIDR = n; // Send byte&lt;BR /&gt;&amp;nbsp;while((SPISR &amp;amp; 0x80) == 0); // Wait for SPI ready SPIF interrupt flag&lt;BR /&gt;&amp;nbsp;PTM = Slave_Off; // To HC595, latch it&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;/* Now forward it to the LCD */&lt;BR /&gt;&amp;nbsp;if(reg == DISP){ // Command or write?&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;c = EN_RST; // Command&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}else{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c = EN; // Write&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;PTT = c; // Tell LCD command or display&lt;BR /&gt;&amp;nbsp;Delay(100);&lt;BR /&gt;&amp;nbsp;PTT = LO; // Tell LCD to do it&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;/*---- Main program ---*/&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;void main(void){&lt;/DIV&gt;&lt;DIV&gt;float freq = -50.56; // Abritary number, would come from freq measurement function&lt;BR /&gt;float PFactor = -0.75;&lt;/DIV&gt;&lt;DIV&gt;char confreq[11];&lt;BR /&gt;char conPF[8];&lt;BR /&gt;int count;&lt;BR /&gt;int len;&lt;/DIV&gt;&lt;DIV&gt;SPI_Set(); // Initialize serial port&lt;BR /&gt;set_lcd(0x38, CMD); // 8-bit, 2 lines&lt;BR /&gt;set_lcd(0x14, CMD); // Disp. on, cursor on, blink&lt;BR /&gt;set_lcd(0x6, CMD); // Cursor moves right space each char&lt;BR /&gt;/*Display static characters*/&lt;BR /&gt;set_lcd(0x46, DISP); // Display F&lt;BR /&gt;set_lcd(0x72, DISP); // Display r&lt;BR /&gt;set_lcd(0x65, DISP); // Display e&lt;BR /&gt;set_lcd(0x71, DISP); // Display q&lt;BR /&gt;set_lcd(0x3A, DISP); // Display :&lt;BR /&gt;set_lcd(0xC0, CMD); // Go to line 2&lt;BR /&gt;set_lcd(0x50, DISP); // Display P&lt;BR /&gt;set_lcd(0x46, DISP); // Display F&lt;BR /&gt;set_lcd(0x3A, DISP); // Display :&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;/*Display measured Frequency and Power Factor*/&lt;BR /&gt;for(;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;{&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;sprintf(confreq, "%.2f Hz", freq); //Convert float freq to character string&lt;BR /&gt;&amp;nbsp;len = strlen(confreq); //String length&lt;BR /&gt;&amp;nbsp;set_lcd(0x86, CMD); //Set cursor position&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(count = 0; count &amp;lt; len; count++){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set_lcd(confreq[count], DISP); //Send 1 character of string to lcd&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;sprintf(conPF, "%.2f", PFactor); //Convert PFactor to character string&lt;BR /&gt;&amp;nbsp;len = strlen(conPF); //String length&lt;BR /&gt;&amp;nbsp;set_lcd(0xC4, CMD); //Set cursor position&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(count = 0; count &amp;lt; len; count++){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set_lcd(conPF[count], DISP); //Send 1 character of string to lcd&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;}&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Mar 2006 18:03:49 GMT</pubDate>
    <dc:creator>marti</dc:creator>
    <dc:date>2006-03-16T18:03:49Z</dc:date>
    <item>
      <title>SPI to HC595 and LCD</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-to-HC595-and-LCD/m-p/128953#M1023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Hi All,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am attempting to output some measured values of frequency and power factor to an LCD module. I am using a 68hc12c32 with codewarrior, programming in C. I am using SPI to transmit the data (PORT M) and 2 general purpose channels (PORT T) for enable and reset bits. I am trying to shift the data through a hc595 serial to parallel shift register.&lt;/DIV&gt;&lt;DIV&gt;I think I may have set up the SPI incorrectly as it does not seem to be operating at all. I am relatively new to both microcontrollers and 'C' programming so have probably made an error somewhere. I have included the code any ideas would be greatly appreciated.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Martin&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/*----Code---*/&lt;/DIV&gt;&lt;DIV&gt;#define Slave_Off 0x8&amp;nbsp;//For setting SS bit&lt;BR /&gt;#define CMD 0&amp;nbsp;&amp;nbsp;// For command mode RST-low, EN-high&lt;BR /&gt;#define DISP 1&amp;nbsp; // For display mode RST-high, EN-high&lt;BR /&gt;#define LO 0x0 // Set all Enable and Reset bits low&lt;BR /&gt;#define EN 0x4 // Set Enable bit High&lt;BR /&gt;#define RST 0x8 // Set reset bit high&lt;BR /&gt;#define EN_RST 0xC // Set Enable and Reset bits high&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;/*--- Port direction and SPI setup ---*/&lt;/DIV&gt;&lt;DIV&gt;void SPI_Set(void){&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;DDRM = 0x38; // Set PortM as output&lt;BR /&gt;&amp;nbsp;DDRT = 0xC;&amp;nbsp; // Set PortT as output&lt;BR /&gt;&amp;nbsp;SPICR1 = 0x52; // Set SPI control register 1&lt;BR /&gt;&amp;nbsp;SPICR2 = 0x10; // Set SPI control register 2&lt;BR /&gt;&amp;nbsp;PTT = 0; // LCD command mode no operation&lt;BR /&gt;&amp;nbsp;PTM = Slave_Off; // hc595 not listening&lt;BR /&gt;}&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/*--- Delay Code ---*/&lt;BR /&gt;/*--- Needs to be configured to Bus clock, Boot 24Mhz, Run 4Mhz ---*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;void Delay(unsigned int sec){&lt;BR /&gt;&amp;nbsp;unsigned int i, j;&lt;BR /&gt;&amp;nbsp;for(i = 0; i &amp;lt; sec; i++){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(j = 0; j &amp;lt; 1000; j++){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;}&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/*-- Routine to send command or character to display --*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;void set_lcd(char n, char reg){&lt;BR /&gt;&amp;nbsp;char c;&lt;/DIV&gt;&lt;DIV&gt;/* First send the byte to the HC595 */&lt;BR /&gt;&amp;nbsp;PTM &amp;amp;= ~Slave_Off; // Listen up, slave&lt;BR /&gt;&amp;nbsp;SPIDR = n; // Send byte&lt;BR /&gt;&amp;nbsp;while((SPISR &amp;amp; 0x80) == 0); // Wait for SPI ready SPIF interrupt flag&lt;BR /&gt;&amp;nbsp;PTM = Slave_Off; // To HC595, latch it&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;/* Now forward it to the LCD */&lt;BR /&gt;&amp;nbsp;if(reg == DISP){ // Command or write?&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;c = EN_RST; // Command&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}else{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c = EN; // Write&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;PTT = c; // Tell LCD command or display&lt;BR /&gt;&amp;nbsp;Delay(100);&lt;BR /&gt;&amp;nbsp;PTT = LO; // Tell LCD to do it&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;/*---- Main program ---*/&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;void main(void){&lt;/DIV&gt;&lt;DIV&gt;float freq = -50.56; // Abritary number, would come from freq measurement function&lt;BR /&gt;float PFactor = -0.75;&lt;/DIV&gt;&lt;DIV&gt;char confreq[11];&lt;BR /&gt;char conPF[8];&lt;BR /&gt;int count;&lt;BR /&gt;int len;&lt;/DIV&gt;&lt;DIV&gt;SPI_Set(); // Initialize serial port&lt;BR /&gt;set_lcd(0x38, CMD); // 8-bit, 2 lines&lt;BR /&gt;set_lcd(0x14, CMD); // Disp. on, cursor on, blink&lt;BR /&gt;set_lcd(0x6, CMD); // Cursor moves right space each char&lt;BR /&gt;/*Display static characters*/&lt;BR /&gt;set_lcd(0x46, DISP); // Display F&lt;BR /&gt;set_lcd(0x72, DISP); // Display r&lt;BR /&gt;set_lcd(0x65, DISP); // Display e&lt;BR /&gt;set_lcd(0x71, DISP); // Display q&lt;BR /&gt;set_lcd(0x3A, DISP); // Display :&lt;BR /&gt;set_lcd(0xC0, CMD); // Go to line 2&lt;BR /&gt;set_lcd(0x50, DISP); // Display P&lt;BR /&gt;set_lcd(0x46, DISP); // Display F&lt;BR /&gt;set_lcd(0x3A, DISP); // Display :&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;/*Display measured Frequency and Power Factor*/&lt;BR /&gt;for(;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;{&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;sprintf(confreq, "%.2f Hz", freq); //Convert float freq to character string&lt;BR /&gt;&amp;nbsp;len = strlen(confreq); //String length&lt;BR /&gt;&amp;nbsp;set_lcd(0x86, CMD); //Set cursor position&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(count = 0; count &amp;lt; len; count++){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set_lcd(confreq[count], DISP); //Send 1 character of string to lcd&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;sprintf(conPF, "%.2f", PFactor); //Convert PFactor to character string&lt;BR /&gt;&amp;nbsp;len = strlen(conPF); //String length&lt;BR /&gt;&amp;nbsp;set_lcd(0xC4, CMD); //Set cursor position&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(count = 0; count &amp;lt; len; count++){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set_lcd(conPF[count], DISP); //Send 1 character of string to lcd&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;}&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 18:03:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-to-HC595-and-LCD/m-p/128953#M1023</guid>
      <dc:creator>marti</dc:creator>
      <dc:date>2006-03-16T18:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: SPI to HC595 and LCD</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-to-HC595-and-LCD/m-p/128954#M1024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello Martin,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Firstly I presume you are trying to interface with an alphanumeric LCD (not a graphical one).&amp;nbsp; I am not entirely clear on the hardware connections you are attempting to use.&amp;nbsp; So here are some possibilities for the interface between the HC595 and the LCD -&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Connect display in "four-bit" mode to the HC595, and connect EN and RS also to the same S/R.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Connect display in 8-bit&amp;nbsp; mode to one S/R, and connect EN &amp;amp; RS to a second S/R device.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Connect display in 8-bit mode to a single S/R, and use separate output pins from the MCU for EN and RS lines.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT size="2"&gt;I suspect you may be attempting the third method.&amp;nbsp; In all cases the RW line should be grounded.&amp;nbsp; For the interface between the MCU and the HC595, the following connections would be required.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;HC595&lt;BR /&gt;Pin 10&amp;nbsp; SCLR = High&lt;BR /&gt;Pin 11&amp;nbsp; SCK = SPI CLK&lt;BR /&gt;Pin 12&amp;nbsp; RCK =&amp;nbsp;Strobe -&amp;nbsp;needs to be a separate MCU&amp;nbsp;output.&lt;BR /&gt;Pin 13&amp;nbsp; /G = Low&lt;BR /&gt;Pin 14&amp;nbsp; SER = SPI MOSI&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The strobe signal would be pulsed at the completion of each SPI transaction, assuming a single S/R.&amp;nbsp; The /SS output signal might&amp;nbsp;be used as the strobe signal&amp;nbsp;with a single S/R, because it outputs a positive edge at the conclusion of the transaction.&amp;nbsp; Either of the following SPI modes should be suitable for the HC595 -&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;CPHA = 0, CPOL = 0 or&lt;BR /&gt;CPHA = 1, CPOL = 1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Before trying to test the operation of the LCD, I would suggest that the SPI operation be separately tested to confirm that the S/R outputs operate in the intended manner.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;You will most likely need to allow a sufficient delay for the LCD to power-up, before trying to initialise it - I would tend to allow something like 200 milliseconds.&amp;nbsp; Also, some LCD commands take much longer to execute than others.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 23:13:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-to-HC595-and-LCD/m-p/128954#M1024</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-03-16T23:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: SPI to HC595 and LCD</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-to-HC595-and-LCD/m-p/128955#M1025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Thanks Mac;&lt;/P&gt;&lt;P&gt;I am indeed using a single S/R in 8 bit mode using&amp;nbsp;SPI with seperate&amp;nbsp;EN and RS connections to the LCD from the MCU.&amp;nbsp;I have possibly got the SPI connections mixed up, at present I have the MOSI conncted to pin 14, SPI CLK connected&amp;nbsp;to pin 11 and SS to pin 13 (Output Enable on the 595). I thought OE was used to latch the data into&amp;nbsp;output of the S/R. You suggest to use&amp;nbsp;pin 12 (master reset on the 595) is that correct as this may be my problem.&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 05:31:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-to-HC595-and-LCD/m-p/128955#M1025</guid>
      <dc:creator>marti</dc:creator>
      <dc:date>2006-03-17T05:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: SPI to HC595 and LCD</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-to-HC595-and-LCD/m-p/128956#M1026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, Martin:&lt;BR /&gt;&lt;BR /&gt;Yes, the 595 is your problem. You are not clocking the shift register into the output register.&lt;BR /&gt;&lt;BR /&gt;OE (sometimes referred to as G) enables the HC595 to drive it's parallel I/O lines. It should be permanently tied low. You need to provide a positive edge on the register-clock pin (RCK, pin 12) after shifting the data into the HC595. This extra step is necessary because the HC595 has an output register in addition to the shift register, which you don't really need.&lt;BR /&gt;&lt;BR /&gt;By the way, a simpler shift register to use would be the HC164, since you would not have to handle the redundant (in your application) holding register. You would tie MOSI to A and B (pins 1 and 2) and SPICLK to CLK (pin 8). You would also want to tie CLR high.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 07:55:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SPI-to-HC595-and-LCD/m-p/128956#M1026</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-03-17T07:55:58Z</dc:date>
    </item>
  </channel>
</rss>

