Pages: [1] 2   Go Down
Author Topic: avr to vfd  (Read 1289 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.



* IMG_20121126_101948.jpg (572.74 KB, 1536x2048 - viewed 20 times.)

* 1126120322.jpg (73.58 KB, 1280x960 - viewed 15 times.)

* IMG_20121126_102035.jpg (611.06 KB, 2048x1536 - viewed 20 times.)

* !!28CMPLS 11-20 LCD ARDUINO CC.PNG (4.1 KB, 480x234 - viewed 13 times.)
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not don here but my 2 cents:

Quote
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.

2) is highly unlikely.

Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also not Don here, I don't know what you have tried already but have you seen this page http://www.noritake-elec.com/codeLibrary.php#cuu 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.49 KB - downloaded 4 times.)
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 --> http://arduino.cc/forum/index.php/topic,106553.msg799389.html#msg799389 <--.  I'll take a look as well and get back later.


Don
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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?


Quote
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?

Quote
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.

Quote
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.

Quote
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
« Last Edit: November 27, 2012, 11:33:19 am by floresta » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 (105.9 KB - downloaded 29 times.)
* source code2.pdf (105.33 KB - downloaded 12 times.)
* source code3.pdf (105.63 KB - downloaded 12 times.)

* merry christmas dad.PNG (3.91 KB, 480x234 - viewed 8 times.)
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AARRGGHH - See the last part of reply #16 in the previous thread (http://arduino.cc/forum/index.php/topic,106553.msg810051.html#msg810051).

Don
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's the vfd physical test results.


* 1127121605.jpg (84.75 KB, 1280x960 - viewed 6 times.)

* 1127121607a.jpg (70.44 KB, 1280x960 - viewed 10 times.)

* 1127121606.jpg (62.28 KB, 1280x960 - viewed 8 times.)

* 1127121606a.jpg (81.33 KB, 1280x960 - viewed 12 times.)
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The timing in your code is wrong. Check the datasheet for timing required for command 0x01.
It's a VFD not an LCD.

Don
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
« Last Edit: November 27, 2012, 08:08:29 pm by floresta » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
(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 --> #.

Code:
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.



Code:
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.

Quote
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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

pics again.

* pics.docx (969.5 KB - downloaded 20 times.)
Logged

Pages: [1] 2   Go Up
Jump to: