avr to vfd

Hi Don,
It has been quite a while. Apologize for the very long hiatus and am hoping that you haven't given up on me here.
Anyhow, since we last communicated I have since tried to get the 20x4 noritake vacuum fluorescent display (CU20045-UW5A) to work, using an uno, a 2560 and now a Ruggeduino (equvlt. to uno). I’ve come up with lots of code, also utilizing the routines for the data write and command write that was obtained on the last occasion, together with delays in the init routine I believe should work, uploaded the adjusted program and still the display does not respond. With this code I just obtained a line of pixels on the LCD. I've recently used modified code from the arduino site for 8 bit mode operation and also incorporated the ‘positional’ feature for placing text data, obtained from source code from the AVR text by Mazidi. This ;combinational' script compiles, uploads and displays information on the 16x2 LCD very well.

Checked the timing diagrams for the uploaded data on a 16 input logic analyzer looking at when and how data is written relative to the enable and RS, RW pins for the LCD, simultaneously linking the circuit to the vfd which did not respond. The diagrams sort of made sense in that I can see data being written when the LCD enable pin in pulsed and RS is low, when the schematic is captured. I altered the delay times between each instruction in accordance with the max times that each instruction should take, and have not exceeded them, compared to those used for the LCD, bearing in mind that the vfd processes information faster than the LCD as shown by the data sheet for the vfd. That said I'm thinking bigger delay times should bring responding as the LCD. Would this have anything to do with altering the timer counter register data structure and prescalar in one of the timer libraries?

I have even tested the vfd grid pins to see if the thing is even working and of the 9 grid pins emanating from the bottom of the display the middle 7 lit up the grids very well, the end 2 nothing! The end filament pins, were hooked up to 3V supply, with a 14V common negative, and the positive end of the 14v supply checking each grid pin.

Any suggestions as to what I should read up to point to the solution to this problem would be greatly appreciated at this 11th hr.

Thanks.

P.S: Just have the wires hooked up as I have for testing purposes now, but once program writes, and the display responds, next step would be to alter the program for the display format, interface a keypad to the arduino for the program, and neatly and compactly integrate display, MCU and keypad within the encasing.

!!28CMPLS 11-20 LCD ARDUINO CC.PNG

Not don here but my 2 cents:

Checked the timing diagrams for the uploaded data on a 16 input logic analyzer looking at when and how data is written relative to the enable and RS, RW pins for the LCD, simultaneously linking the circuit to the vfd which did not respond.

If you are sure of the 1st half of your sentence, then

  1. you have a defective device; or

  2. you have a device that deviates from the datasheet.

  3. is highly unlikely.

Also not Don here, I don't know what you have tried already but have you seen this page Code Library - Noritake Co., Inc. Electronics Division it links to a AVR compatible library (attached). The library may convert to Arduino with little or no changes or maybe someone here will help. The site also seem to have datasheets for a CU20045-UW5A VFD but you need to register to get it. I seem to have found a datasheet here http://www.8051projects.net/e107_files/public/1338569803_38288_FT0_c20045-uw5a_adatlap.pdf

Noritake_VFD_CUU.zip (20.5 KB)

Well I am 'Don'. I'm retired so I sleep late and I don't remember much when I get up.

Here's a link to the original thread for the others to mull over --> arduino for vfd - Displays - Arduino Forum <--. I'll take a look as well and get back later.

Don

With this code I just obtained a line of pixels on the LCD.

Which code?
Pixels or blocks? On row 1 or on rows 1 and 3?

The diagrams sort of made sense in that I can see data being written when the LCD enable pin in pulsed and RS is low...

Channels 0 through 6 look reasonable assuming that you are trying to display the characters 'D' and 'B'. What is channel 7 showing?

I altered the delay times between each instruction in accordance with the max times that each instruction should take, and have not exceeded them,...

You must exceed them otherwise your display may not be ready to accept more data.

Would this have anything to do with altering the timer counter register data structure and prescalar in one of the timer libraries?

If you have changed anything relating to Timer/Counter 0 then this could certainly affect the Arduino delay() functions.

Any suggestions ...

I really cannot make any suggestions without seeing the code along with clear photographs of the interconnections and the resulting screen.
You seem to have at least one LCD functioning. What code did you use for that one?

Don

These are the scripts. For the third one, changed the delay times for the init routine in accordance with the very helpful Noritake link from Riva; thanks, but i get only an 's' character at (0,0) on the LCD, and still nothing on the VFD. The program also compiled . Saw strong 3V voltages at the filament pins and the expected voltages at the control pins, and some data pins at 5 volts. Also rechecked the vfd to ensure it lights up. Beginning to wonder if, but hoping that it's not, the controlling chip.

source code1.pdf (106 KB)

source code2.pdf (105 KB)

source code3.pdf (106 KB)

merry christmas dad.PNG

AARRGGHH - See the last part of reply #16 in the previous thread (arduino for vfd - #17 by floresta - Displays - Arduino Forum).

Don

i get only an 's' character at (0,0) on the LCD,

The timing in your code is wrong. Check the datasheet for timing required for command 0x01.

Here's the vfd physical test results.

The timing in your code is wrong. Check the datasheet for timing required for command 0x01.

It's a VFD not an LCD.

Don

Here's the vfd physical test results.

It looks like you need a tripod. The pictures wouldn't be of much use anyway since we don't know which of your programs is associated with which picture.

You will get more input regarding your source code if you post it as part of the thread rather than as a pdf attachment. Have you noticed how many people have looked at your source code compared to how many people have looked at the thread?

I suggest that you pick one of your programs, post the code, post a legible picture of the interconnections between the display and the Arduino, and post a legible picture or explanation of exactly what appeared on the display when you ran that code.

Don

K.

[code-68].................................(compiles uploads and gives only one character 's')

#include <util/delay.h>
#include <LiquidCrystal.h>
#include <C:\Users\DAVERENA\Desktop\NOVEMBER 2012\Noritake_VFD_CUU\src\config.h>
#include <C:\Users\DAVERENA\Desktop\NOVEMBER 2012\Noritake_VFD_CUU\src\interface.h>
#include <C:\Users\DAVERENA\Desktop\NOVEMBER 2012\Noritake_VFD_CUU\src\Noritake_VFD_CUU.h>

int RS = 12;
int RW = 11;
int DB[] = {3,4,5,6,7,8,9,10};
int Enable = 2;
///////////////////////////////////////////////////////////////////////////
void LcdCommandWrite(int value) {
// poll all the pins
int i = 0;
for (i=DB[0]; i <= RS; i++) {
digitalWrite(i,value & 01);
value >>= 1;
}
digitalWrite(Enable,LOW);
delayMicroseconds(1);
// send a pulse to enable
digitalWrite(Enable,HIGH);
delayMicroseconds(1); // pause 1 ms according to datasheet
digitalWrite(Enable,LOW);
delayMicroseconds(1); // pause 1 ms according to datasheet
}
//////////////////////////////////////////////////////////////////////////
void LcdDataWrite(int value) {
// poll all the pins
int i = 0;
digitalWrite(RS, HIGH);
digitalWrite(RW, LOW);
for (i=DB[0]; i <= DB[7]; i++) {
digitalWrite(i,value & 01);
value >>= 1;
}
digitalWrite(Enable,LOW);
delayMicroseconds(1);
// send a pulse to enable
digitalWrite(Enable,HIGH);
delayMicroseconds(1);
digitalWrite(Enable,LOW);
delayMicroseconds(1); // pause 1 ms according to datasheet
}
///////////////////////////////////////////////////////////////////////////////
void setup () //.................................... DIFFERENCE!!!!!!!!!!!!!!INITIATION ROUTINE from Noritake Site
{
int i = 0;
for (i=Enable; i <= RS; i++) {
pinMode(i,OUTPUT);
}
delay(300);// initiatize lcd after a short pause needed by the LCDs controller

LcdCommandWrite(0x30); // function set: 8-bit interface, 1 display lines, 5x7 font
delayMicroseconds(1);

LcdCommandWrite(0x30); // function set:8-bit interface, 1 display lines, 5x7 font
delayMicroseconds(1);

LcdCommandWrite(0x30); // function set:8-bit interface, 1 display lines, 5x7 font
delayMicroseconds(1);

LcdCommandWrite(0x30); // function set:8-bit interface, 1 display lines, 5x7 font
delayMicroseconds(1);

LcdCommandWrite(0x0F); // display control:turn display on, cursor on, blinking
delayMicroseconds(1);

LcdCommandWrite(0x01); // clear display, set cursor position to zero
delayMicroseconds(200);

LcdCommandWrite(0x80); // display control:turn display off, cursor off
delayMicroseconds(1);

}
/////////////////////////////////////////////////////////////////////////////
//*******************************************************
void Lcd_gotoxy(unsigned char x, unsigned char y)
{
unsigned char firstCharAdr[]={0x80,0xC0,0x94,0xD4};//table 12-5
LcdCommandWrite(firstCharAdr[y-1] + x - 1);
delayMicroseconds(100);
}

//*******************************************************
void Lcd_print( char * str )
{
unsigned char i = 0 ;
while(str*!=0)*

  • {*
    _ LcdDataWrite(str*);_
    _
    i++ ;_
    _
    }_
    _
    }_
    _//********************************************_
    void loop()
    _
    { _
    _
    setup();
    _
    Lcd_gotoxy(1,1);

    Lcd_print("MERRY CHRISTMAS");

    Lcd_gotoxy(1,2);

    Lcd_print("MOM!!!");

* while(1); *

}
[/code-68]
Physical interconnections and character display as shown in pics taken.

i tried over and over getting the pics and timing diagram sent for some reason each time kept getting my session timed out or my message sent exceeded 4096kb....sent pics on a word doc and got the same thing.... very frustrating. have to integrate the handheld together in 3wks time with a keypad, and not feeling happy at this point.

(compiles uploads and gives only one character 's')

And where does that character appear?

Your code will be a lot easier to read if you highlight it and then press the 'Code' button --> #.

void loop()
{   
   setup();
   Lcd_gotoxy(1,1);
   Lcd_print("MERRY CHRISTMAS");
   Lcd_gotoxy(1,2);
   Lcd_print("MOM!!!");
   
   while(1);            
       
}

This is a really strange configuration and I really don't know what is going to happen since I don't know a whole lot about 'C' .

When you run an Arduino sketch the code in setup() is run once and then the code in loop() is run continuously.

So by the time your program gets to the part that I have displayed it has already run setup(). When it gets here it runs setup() again, it attempts do display information on the LCD, and then it hits while(1).

I think (hope) you are trying to stop the loop but I don't know what will happen without brackets. I'm used to seeing while(1) { }. At any rate you should just put the stuff that is writing to the LCD in setup() and leave loop() empty.

LcdCommandWrite(0x30);  // function set: 8-bit interface, 1 display lines, 5x7 font
...
Lcd_gotoxy(1,2);

Add the missing comment and then figure out what is wrong.

Physical interconnections and character display as shown in pics taken.

Which picture satisfies this request? "post a legible picture of the interconnections between the display and the Arduino"

Don

pics again.

pics.docx (969 KB)

I guess there is probably an Arduino in there somewhere.

Don

Tried the alteration you suggested; the same result after upload.

void initialize() // DIFFERENCE!!!!!!!!!!!!!!INITIALIZATION ROUTINE from Noritake Site
{
 int i = 0;
 for (i=Enable; i <= RS; i++) {
   pinMode(i,OUTPUT);
}
 delay(300);              // initiatize lcd after a short pause needed by the LCDs controller
 
 LcdCommandWrite(0x30);  // function set: 8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);
 
 LcdCommandWrite(0x30);  // function set:8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);
 
 LcdCommandWrite(0x30);  // function set:8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);                        
 
 
 LcdCommandWrite(0x30);  // function set:8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);                        
                                                                  
 LcdCommandWrite(0x0F);  // display control:turn display on, cursor on, blinking
 delayMicroseconds(1);                        
                       
 LcdCommandWrite(0x01);  // clear display, set cursor position to zero  
 delayMicroseconds(200);
 
 LcdCommandWrite(0x80);  // display control:turn display off, cursor off
 delayMicroseconds(1);                        
                      
}
/////////////////////////////////////////////////////////////////////////////
//*******************************************************
void Lcd_gotoxy(unsigned char x, unsigned char y)
{  
 unsigned char firstCharAdr[]={0x80,0xC0,0x94,0xD4};//table 12-5  
 LcdCommandWrite(firstCharAdr[y-1] + x - 1);
 delayMicroseconds(100);	
}

//*******************************************************
void Lcd_print( char * str )
{
  unsigned char i = 0 ;
  while(str[i]!=0)
  {
    LcdDataWrite(str[i]);
    i++ ;
  }
}

//*******************************************************
void setup(){
	initialize();
	Lcd_gotoxy(1,1);      // begin on (0,0) row1
	Lcd_print("MERRY CHRISTMAS");
	Lcd_gotoxy(1,2);       // begin on (0,1) row2
	Lcd_print("MOM!!!");
	while (1){};
}
void loop() 
{			
    	
}

Your photograph shows at least four displays. It looks like three of them are LCDs and one is a VFD. I thought we are dealing with the VFD since that is what is is in the forum title yet it is one of the LCDs that seems to be displaying a single 'S'. If that is the 'S' to which you were referring then why did you call it an 's' ?

There is no place in your program where you are sending an 's' to the LCD but the last character that you are sending to the top line is an 'S'. Try putting a delay in there and see if all of the characters are actually being sent but all you are seeing is the last one.

Tried the alteration you suggested; the same result after upload.

Let's try this part again.

...  // function set: 8-bit interface, 1 display lines, 5x7 font
...
... // begin on (0,0) row1
...
... // begin on (0,1) row2

While you are at it - here are the previous questions you haven't answered and the requests that you have not fulfilled so far. These are just for this thread, they do not include the one in May.

Reply #4
-Which code?
-Pixels or blocks?
-On row 1 or on rows 1 and 3?
-What is channel 7 showing?
-I really cannot make any suggestions without seeing the code along with clear photographs of the interconnections and the resulting screen.
-You seem to have at least one LCD functioning. What code did you use for that one?

Reply #10
-...we don't know which of your programs is associated with which picture.
-I suggest that you pick one of your programs, post the code, post a legible picture of the interconnections between the display and the Arduino, and post a legible picture or explanation of exactly what appeared on the display when you ran that code.

Reply #13
-And where does that character appear?
-Which picture satisfies this request? "post a legible picture of the interconnections between the display and the Arduino"

Don

Your photograph shows at least four displays. It looks like three of them are LCDs and one is a VFD. I thought we are dealing with the VFD since that is what is is in the forum title yet it is one of the LCDs that seems to be displaying a single 'S'. If that is the 'S' to which you were referring then why did you call it an 's' ?

There is no place in your program where you are sending an 's' to the LCD but the last character that you are sending to the top line is an 'S'. Try putting a delay in there and see if all of the characters are actually being sent but all you are seeing is the last one.

The 16x2 with back light is running with the 2560; there is a problem getting print onto the 2nd line.
It's an 's' and when i add the bigger delay as you suggested, i do get the 1st line of data merry christmas but not the 2nd line.
Im running the 2 displays at the same time in the hope i will see the vfd come while making adjustments to the program that works with the LCD which is why I sent the 3 pdfs with 3 sketches showing the progression from the 1st to the 3rd and more recent.
The link that the forum member Ravi provided to the noritake site gave me the init routine for this type of vfd and that's what i used, and then came up with the 's' character; figured a smaller delay for the vfd would be required compared to the lcd and that's why some of the info disappeared.
Of all the groups preparing for presentations, I am the only one who has not integrated yet. I still have to put a keypad to talk to the display directly through the MCU, displaying data first to field 3, then on hitting enter, have the data put onto field 1 with field 3 cleared.
My project coordinator has strongly suggested that i get to this and put the thing together, given i have still the updated report to submit, plus powerpoint...before the 10th.
I am starting to think that the vfd controller chip could be faulty so I'm just gonna go ahead and work the LCD which gives me the data for now. Kind of disappointed having taking so long trying to get this thing to work.
Anyhow, I hope what I've sent covers all you wanted, save the timing diagram channel 7; when the data is on, that's what I'm getting in terms of all the channels the scope is wired up to.
Dave.

Circuit Connection.docx (21.2 KB)

... there is a problem getting print onto the 2nd line.

I have pointed out the problem twice, in first in Reply #13 ...

LcdCommandWrite(0x30);  // function set: 8-bit interface, 1 display lines, 5x7 font
...
Lcd_gotoxy(1,2);

... and again in Reply #17.

...  // function set: 8-bit interface, 1 display lines, 5x7 font
...
... // begin on (0,0) row1
...
... // begin on (0,1) row2

If you don't get this resolved you will never see anything on the second line no matter what else you do.

figured a smaller delay for the vfd ...

These devices can work with DC, that is you can use switches to set the logic levels and a push button to pulse the Enable line. A longer delay will never keep the device from working properly.

Don