CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

serial write to gu128x64-330 noritake VFD?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
racerx



Joined: 30 Aug 2005
Posts: 6

View user's profile Send private message Visit poster's website

serial write to gu128x64-330 noritake VFD?
PostPosted: Tue Aug 30, 2005 4:54 pm     Reply with quote

Hello,
I have been trying to write serially to a noritake GU128x64-330 display.
the default mode to talk is
19.2k, even parity.

information removed, because I was an idiot to post without it right in front of me.
please see below for correct information.
thank you pcm for pointing to the correct spec.


Last edited by racerx on Wed Aug 31, 2005 11:19 am; edited 2 times in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 30, 2005 6:19 pm     Reply with quote

Quote:
I have been trying to write serially to a noritake gui128x64-330 display.

Is that part number accurate ?
The search engine on the Noritake website doesn't find it.
Goggle doesn't find it.
Is it really gu128x64-330 ? (ie., with no "i" after the "gu")

If so, Noritake is one of those companies that won't give out the
data sheet. However, an alternate site appears to have it.
http://www.elektronica-it.com/Itron/

Is this the data sheet you're using:
http://www.elektronica-it.com/Itron/GU128X64-330_E01.pdf

If so, I don't see the command sequence that you specified in your
post, given in the data sheet. What page of the data sheet shows
that sequence ?
racerx



Joined: 30 Aug 2005
Posts: 6

View user's profile Send private message Visit poster's website

PostPosted: Tue Aug 30, 2005 6:53 pm     Reply with quote

sorry, yes that is the correct part number. On page 3 they talk about the character write mode. On page 12 they talk about the serial write timing.
I can post the source code in the morning, the code above is off the top of my head.
thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 30, 2005 7:19 pm     Reply with quote

Quote:
the code above is off the top of my head.


Grrrr....

Next thread.
racerx



Joined: 30 Aug 2005
Posts: 6

View user's profile Send private message Visit poster's website

PostPosted: Wed Aug 31, 2005 6:10 am     Reply with quote

sorry, no code off top of head ever again!

here is the lcd only portion:

Code:


#include <16f88.h>
#fuses   HS,NOLVP,NOWDT,PUT,MCLR
#use delay(clock=20000000)
#use rs232(baud=19200, xmit=PIN_A4, parity=e, stream=LCD)
#use rs232(baud=38400, xmit=PIN_B5, rcv=PIN_B2, parity=n, stream=PORT)


#define WR PIN_A2       // output RED/WRITE
#define RESET PIN_A3   // output WHITE/RESET
#define SIN PIN_A4    // output ORANGE/Serial IN
#define BUSY PIN_B0   // input  BLUE/BUSY

#byte PORT_B = 0x06
#byte ANSEL = 0x9B

main()
{
  /* init registers */
  set_tris_a(0b11100010); // RA1 not used, RA0, RA4:2 output, RA5 = mclr , RA7:6 OSC
  set_tris_b(0b11011111); // port b all input, RB5 tx out
  ANSEL = 0x00;   // disable all A/D and make them digital I/0
 
  // reset the display by bringing the reset line low
  output_low(RESET);
  delay_ms(10);
  output_high(RESET);
  delay_ms(210); //wait 210 mS for display to fully power back up
  // write to the display
  output_low(WR);
  fprintf(LCD, "\x01\x43");
  fprintf(LCD, "\x00\x01");
  fprintf(LCD, "SR");
  output_high(WR);
}



Last edited by racerx on Wed Aug 31, 2005 10:55 am; edited 1 time in total
Ttelmah
Guest







PostPosted: Wed Aug 31, 2005 9:14 am     Reply with quote

What you post in neither case agrees with what you say the unit needs. The sequence:
fprintf(LCD,"\x01\x43\x52\x01\x72");

sends 01+<C>+<R>+01+<r>
not the 'CS' you say is needed. Similarly on the latter code, you send:
01+<C>+00+01+<S>+<R>

Try:

fprintf(LCD,"\x01CS\x01r");

Also if you want to control the TRIS lines, switch to using fast_io, otherwise the settings you make will be overridden as soon as you do an I/O instruction.

Best Wishes
racerx



Joined: 30 Aug 2005
Posts: 6

View user's profile Send private message Visit poster's website

PostPosted: Wed Aug 31, 2005 11:16 am     Reply with quote

from the spec exactly:

8.2 Structure of data block
A data block consists of "Header", "Op code" and "Data".
"Header" + "Op code" + "Data"
01HEX 1Byte
"Header": 01HEX
"Op Code" : Operation code which specify a type of "Data" such as Graphics, charater and command.
"Data" : Data block

8.3 Op code
8.3.1 Charater Write
Op code: "C"
Format
01HEX + "C"(43HEX) + Start ADRS (1Byte) + LEN(1Byte) + Write Mode(1Byte) + chr(1) + chr(2) + ... + chr(LEN)

so I try to send R to the lcd on line one at Adrs 00
fprintf(LCD, "\x01C\x00\x01SR");

so if I echo this command to minicom, I only get .C back from the fprintf, and not the .CSR that I think I should get.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 31, 2005 11:36 am     Reply with quote

add a while(1) to the bottom of your main. The way you have it, it hits a hidden sleep instruction after main before the uart is finished transmitting.
racerx



Joined: 30 Aug 2005
Posts: 6

View user's profile Send private message Visit poster's website

PostPosted: Wed Aug 31, 2005 12:35 pm     Reply with quote

the fprintf command bombs out if you try to send \x00 for the address, perhaps there is some kind of internal parsing occuring with it?
i use \x01 and bam the charater is on the screen!

Code:

#include <16f88.h>
#fuses   HS,NOLVP,NOWDT,PUT,MCLR
#use delay(clock=20000000)
#use rs232(baud=19200, xmit=PIN_A4, parity=e, stream=LCD)
//#use rs232(baud=38400, xmit=PIN_B5, rcv=PIN_B2, parity=n, stream=PORT)


#define WR PIN_A2       // output RED
#define RESET PIN_A3   // output WHITE
#define SIN PIN_A4    // output ORANGE
#define BUSY PIN_B0   // input  BLUE

#byte PORT_B = 0x06
#byte ANSEL = 0x9B

main()
{
  /* init registers */
  set_tris_a(0b11100010); // RA4:2 output, RA5 = mclr , RA7:6 OSC
  set_tris_b(0b11011111); // port b all input, RB5 tx out
  ANSEL = 0x00;   // disable all A/D and make them digital I/0
 
  output_low(RESET);
  delay_ms(10);
  output_high(RESET);
  delay_ms(210); //wait 2 seconds for display
  fprintf(LCD, "\x01C\x01\x01SR");
  while(1);
}

Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 31, 2005 1:21 pm     Reply with quote

I don't believe that you can send 0 (null) with a printf command. That usually signifies the end of a string.
racerx



Joined: 30 Aug 2005
Posts: 6

View user's profile Send private message Visit poster's website

PostPosted: Wed Aug 31, 2005 1:53 pm     Reply with quote

is there a command to do serial out like serout or serout2 in picbasic?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 31, 2005 2:31 pm     Reply with quote

putc()
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group