Author Topic: VFD multiplexing.  (Read 13121 times)

0 Members and 2 Guests are viewing this topic.

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #25 on: August 09, 2017, 03:13:19 am »
Post the code + any questions you've got + maybe a video of the animation, or just keep hacking on it till you understand it better.
 
The following users thanked this post: neo

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #26 on: August 09, 2017, 03:17:47 am »
Code: [Select]
/*
Adafruit Arduino - Lesson 4. 8 LEDs and a Shift Register
*/

int latchPin = 5;
int clockPin = 6;
int dataPin = 4;

byte leds = 0;

void setup()
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT); 
  pinMode(clockPin, OUTPUT);
}

void loop()
{
  leds = 129;
  updateShiftRegister();
  delay (500);
  leds = 66;
  updateShiftRegister();
  delay (500);
  leds = 36;
  updateShiftRegister();
  delay (500);
  leds = 24;
  updateShiftRegister();
  delay (500);
  leds = 36;
  updateShiftRegister();
  delay (500);
  leds = 66;
  updateShiftRegister();
  delay (500);
  leds = 129;
  updateShiftRegister();
  delay (500);
}

void updateShiftRegister()
{
   digitalWrite(latchPin, LOW);
   shiftOut(dataPin, clockPin, LSBFIRST, leds);
   digitalWrite(latchPin, HIGH);
}

The animation itself is dead simple, outer edges to center, both lines meet continue and repeat. It looks like top and bottom are switching places over and over.

Only thing i don't get in that is the byte command.
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #27 on: August 09, 2017, 03:33:55 am »
byte is an Arduinoism.  In more standard dialects of ANSI C or C++ (or at least ones with less cruft on top of the standard stuff) it would be unsigned char or on C99 upwards uint8_t, both of which are accepted by the GCC compiler that the Arduino IDE uses.
It (along with its equivalents) is the name of a data type - a single unsigned eight bit number aka a byte.
Code: [Select]
byte leds=0; declares a byte sized variable called leds.  As its a single unsigned byte it can only hold numbers in the range 0 to 255.  It also gives it an initial value of 0. C will zero any variable that isn't explicitly initialised, but its good practice to put the =0 there if your code relies on it starting from zero later on.

See https://learn.sparkfun.com/tutorials/data-types-in-arduino for a more thorough explanation of Arduino data types.

N.B. as no Arduino has more than 255 I/O pins, the system code uses 8 bit values for the pin number in all I/O functions that need one.   You can save a few bytes of program and data memory  by using the byte type for those pin number variables.   Also as the pin numbers are fixed by the hardware connections and cant change while the program is running, they should be constants:
Code: [Select]
const byte latchPin = 5;
const byte clockPin = 6;
const byte dataPin = 4;
« Last Edit: August 09, 2017, 03:48:11 am by Ian.M »
 
The following users thanked this post: neo

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #28 on: August 09, 2017, 04:40:22 am »
Since i can't order the parts until after hamfest i expect there to be a long delay then i will tell you if it works or not.
Thank you Ian you have been very helpful.
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #29 on: August 09, 2017, 05:14:37 am »
No worries.   When you get the parts build it up one stage at a time and check it does what you expect.  e.g. start with the 4017 and a debounced switch to clock it manually.   then add ONE 4508 but don't parallel its Qn outputs with the other half's corresponding Qn pin yet.
Set the counter to reset at 3 so it counts 0 1 2 and connect the 0 and 1 outputs to inverters and them to the 4508 output disable pins.  Tie the 4508 resets high for testing to force '0' into all the latches. check that as you click the counter first one then the other half of the 4508 gets its outputs activated - you can use a resistor + LED between Vcc and one of the outputs - then finally both halves go tri-state as the counter goes to 2.   Once you've confirmed that you are good to go to start parralling corresponding numbered Q pins and hook them up to the 4053.  For initial testing, hook up the 4053 outputs to a single LED digit.   Tie the 4508 reset pins low so you can load data into them and check you can display one digit you loaded at a time on the display.  Then add more 4508 chips up to N_digits/2, and set up the reset for the 4017 accordingly.  Check each is selected in turn then hook their outputs to the BCD bus.

That will give you the core of the logic working without burning any chips.  Add a CMOS 555 clock of approximately 100*N_digits Hz and it will be ready to drive a logic level multiplexed display.  Slow the clock down by patching in a *100 timing cap if you want to see it scan through all the digits slowly enough to check them.   Then you can concentrate on the HV drivers and the filament supply and bias.  A good DC level for the cathode (filament) for many planar VFDs is +5V with a +30V supply to  the HV drivers.   For the filament itself you ideally want AC drive, and the easiest is straight 50Hz or 60Hz from a dedicated secondary on your PSU's mains transformer, with a series resistor to drop the voltage to get the filament suply correct. Across the filament  put two equal resistors to form an artificial center tap  While you *can* use DC, the voltage drop across the filament will cause uneven brightness from one end o a longer display to the other.  Whatever you do, remember the hot resistance is many times the cold resistance, so the voltage to and thus the dissipation of a filament driven via a series resistor tends to increase as it warms up so, to avoid overdriving it you need to sneak up on the correct filament voltage gradually, decreasing the resistor a little at a time.  If the filament is glowing noticeably you are overdriving it. You should only just be able to see the faintest of dull glows from the filament in a totally dark room with all the segments off.

Take it slow and check each step and you should be able to keep all the magic smoke inside the chips . . .

IMPORTANT: THE BCD BUS TO THE 7 SEG DECODER COMES FROM THE  PARALLELLED 4508 Q0 THROUGH Q3 OUTPUTS.  I mistakenly wrote D0 - D3 earlier - Dn are inputs not outputs.
« Last Edit: August 09, 2017, 10:14:14 am by Ian.M »
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #30 on: August 09, 2017, 06:04:30 am »
Take it slow and check each step and you should be able to keep all the magic smoke inside the chips . . .

I certainly hope to keep the magic smoke inside given the initial cost of the prototype.  :-DD
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #31 on: August 09, 2017, 10:17:55 am »
While you are waiting for parts, why not reread your old topic: https://www.eevblog.com/forum/projects/vacuum-fluorescent-display-multiplexing-problem/ as it covered a lot of the details of driving a VFD off logic circuits in *MUCH* detail, and ask about anything that you didn't understand (apart from the SPI stuff which you can skim over if your mission is to build a discrete logic multiplexed VFD driver).
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #32 on: August 09, 2017, 10:40:12 pm »
I bought a VFD module and when i got it i tried to remove the shrouded header and broke a couple contact points, i know i know save the  :horse: i am doing worse to myself, and using tiny wire i was able to route connections all except for one.
Reset, i assumed to the on board micro controller but when powered up with reset ground it is meant to make the entire display light up, and instead does nothing.
http://www.ebay.com/itm/New-20X2-alphanumeric-VFD-Display-5VDC-Parallel-Arduino-library-file-pinouts/272260289885?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

Did i break this thing or can i still make it work? As i said i have every other connection right.
Also of interest is that thing this thing uses a very similar set up to what we were talking about.
http://ecee.colorado.edu/~mcclurel/dm74ls373.pdf
http://pdf1.alldatasheet.com/datasheet-pdf/view/11020/OKI/MSC1162.html   2 of these
http://www.nxp.com/docs/en/data-sheet/8XC51_8XC52.pdf
« Last Edit: August 09, 2017, 10:48:58 pm by neo »
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #33 on: August 09, 2017, 10:44:58 pm »
So what pins did you break?  closeup photos would be good . . .

Is Reset the only one you couldn't reconnect?
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #34 on: August 09, 2017, 10:48:14 pm »
So what pin did you break?  closeup photos would be good . . .

Reset, the rest i know are right and my camera does not do closeups well.
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #35 on: August 09, 2017, 10:52:42 pm »
Well, the EBAY ad implies that if you do nothing else apart from apply 5V you should see a flashing cursor.  If not, and your PSU is adequate, its probably faulty. and odds are something else cracked when you FUBARed the header.
« Last Edit: August 09, 2017, 10:55:50 pm by Ian.M »
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #36 on: August 09, 2017, 10:55:15 pm »
Well, the EBAY ad implies that if you do nothing else apart from apply 5V you should see a flashing cursor.  If not, its probably faulty. and odds are something else cracked when you FUBARed the header.
It don't flash, but there is a cursor.
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #37 on: August 09, 2017, 10:59:02 pm »
Ok signs of life then.  Its still got vacuum, filament drive, HT and multiplexing. 

How are you testing it?  Are you 100% sure you've got the 8 data lines, and strobe hooked up correctly?
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #38 on: August 09, 2017, 11:02:04 pm »
I attached power, - to - and +5 to +5 it lit a cursor. Removed 5V, grounded reset, reapplied 5V and it did not light up.
The exact opposite of lighting up actually, the cursor went off.
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #39 on: August 09, 2017, 11:13:37 pm »
So the test mode isn't working.    Have you tried hooking it up to an Arduino and running any demo that came with their library?
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #40 on: August 09, 2017, 11:15:13 pm »
I never got a library, i assumed the test mode wasn't working because i didn't have the right reset.
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #41 on: August 10, 2017, 12:00:29 am »
Google is your friend. 

This looks possible: http://www.torretje.nl/Projects/Futaba
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #42 on: August 10, 2017, 12:15:36 am »
Google is your friend. 

This looks possible: http://www.torretje.nl/Projects/Futaba

Code: [Select]
/* NA202SD08FA VFD Display
 Karel Reinhard 04/13/2016
 Basic code for NA202SD08FA 20x2 VFD
 With 13 pin connector see [url]http://torretje.nl/futaba[/url] for pin-out and data-sheet
 */
 
//NA202SD08FA 14 pin connector 2 pins for power-supply and pin 1 and 13 NC :
const int RST = 11; //J1-14
const int WR =  10; //J1-2
const int DB0 =  2; //J1-10
const int DB1 =  3; //J1-9
const int DB2 =  4; //J1-8
const int DB3 =  5; //J1-7
const int DB4 =  6; //J1-6
const int DB5 =  7; //J1-5
const int DB6 =  8; //J1-4
const int DB7 =  9; //J1-3
//Add all data ports to an Array
int outData[8]={DB0,DB1,DB2,DB3,DB4,DB5,DB6,DB7};



void setup() {
  // set the digital pin as output:
  pinMode(RST, OUTPUT);   
  pinMode(WR, OUTPUT);     
  pinMode(DB0, OUTPUT);     
  pinMode(DB1, OUTPUT);     
  pinMode(DB2, OUTPUT);     
  pinMode(DB3, OUTPUT);     
  pinMode(DB4, OUTPUT);     
  pinMode(DB5, OUTPUT);     
  pinMode(DB6, OUTPUT);     
  pinMode(DB7, OUTPUT);
  //RESET     
  digitalWrite(RST, 1);
  delay(500);
  digitalWrite(RST, 0);
}

void loop()
{
 
  setData(0x1F);

  for(int y=0x20;y<0x7F;y++){
    setData(0x16);//Soft RESET
    for(int i=0;i<40;i++){
        setData(y);
     }
           delay(100);
  }

    for(int y=0xA0;y<0xFF;y++){
    setData(0x16);//Soft RESET

      for(int i=0;i<40;i++){
        setData(y);
       
      }
      delay(100);
    }

}

void setData(byte data){
   int i=0;
   for (byte mask = B00000001; mask>0; mask <<= 1) {
     if (data & mask){ // if bitwise AND resolves to true
       digitalWrite(outData[i],HIGH);
    }else{ //if bitwise and resolves to false
       digitalWrite(outData[i],LOW);
    }
    i++;
  }
  digitalWrite(WR, 1);
  delayMicroseconds(2500);
  digitalWrite(WR, 0);
}



Thank you it seems to be working the cursor now flashes.
What do i do know? i don't understand all of the code, the entire void loop portion for example.
« Last Edit: August 10, 2017, 12:18:36 am by neo »
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #43 on: August 10, 2017, 12:21:53 am »
If I'm reading that code correctly, in loop() it loops through the whole character set, sending each character 40 times so the whole display fills with it, then waits 1/10 second, soft resets the display and moves on to the next character. Each for(int y ...) loop handles half the character set, skipping control codes.  The for(int i ...) loops send the current character y 40 times using setData(y);

If that's not what you are getting you still have a problem . . .
« Last Edit: August 10, 2017, 12:27:20 am by Ian.M »
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #44 on: August 10, 2017, 12:23:28 am »
If I'm reading that code correctly, it loops through the whole character set, sending each character 40 times so the whole display fills with it, then waits 1/10 second, soft resets the display and moves on to the next character.

If that's not what you are getting you still have a problem . . .

All i get is a flashing cursor, so i have no clue what to do next.

EDIT:
I had the wires one pin too far over, i put them where they should be now not even the cursor flashes.
« Last Edit: August 10, 2017, 12:26:51 am by neo »
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #45 on: August 10, 2017, 12:31:10 am »
Sounds like your connections are still scrambled.  Jumper the Arduino Reset pin to Gnd to hold the Arduino in Reset so it does absolutely nothing, and power it up again to see if you get a cursor like you did originally.  If its totally blank either something really bad has happened or it has memory backup for its modes and your screwup sent a 'Display Off' command'
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #46 on: August 10, 2017, 12:33:21 am »
The cursor IS there it is just stationary, solid non flashing line.

EDIT:
If reset is pulsed the cursor flashes.
« Last Edit: August 10, 2017, 12:37:25 am by neo »
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13133
Re: VFD multiplexing.
« Reply #47 on: August 10, 2017, 12:43:11 am »
OK: double check your wiring.  When you FUBARed and then patched the header connections, did you get two wires mixed up or shorted together?
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #48 on: August 10, 2017, 12:47:30 am »
OK: double check your wiring.  When you FUBARed and then patched the header connections, did you get two wires mixed up or shorted together?

I am at least 97% sure it is correct.
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: VFD multiplexing.
« Reply #49 on: August 10, 2017, 01:00:52 am »
I uploaded

Code: [Select]
/* NA202SD08FA VFD Display
 Karel Reinhard 04/13/2016
 Basic code for NA202SD08FA 20x2 VFD
 With 13 pin connector see http://torretje.nl/futaba for pin-out and data-sheet
 */
 
//NA202SD08FA 14 pin connector 2 pins for power-supply and pin 1 and 13 NC :
const int RST = 11; //J1-14
const int WR =  10; //J1-2
const int DB0 =  2; //J1-10
const int DB1 =  3; //J1-9
const int DB2 =  4; //J1-8
const int DB3 =  5; //J1-7
const int DB4 =  6; //J1-6
const int DB5 =  7; //J1-5
const int DB6 =  8; //J1-4
const int DB7 =  9; //J1-3
//Add all data ports to an Array
int outData[8]={DB0,DB1,DB2,DB3,DB4,DB5,DB6,DB7};



void setup() {
  // set the digital pin as output:
  pinMode(RST, OUTPUT);   
  pinMode(WR, OUTPUT);     
  pinMode(DB0, OUTPUT);     
  pinMode(DB1, OUTPUT);     
  pinMode(DB2, OUTPUT);     
  pinMode(DB3, OUTPUT);     
  pinMode(DB4, OUTPUT);     
  pinMode(DB5, OUTPUT);     
  pinMode(DB6, OUTPUT);     
  pinMode(DB7, OUTPUT);
  //RESET     
  digitalWrite(RST, 1);
  delay(500);
  digitalWrite(RST, 0);
}

void loop()
{
  digitalWrite (DB0, LOW);
  digitalWrite (DB1, LOW);
  digitalWrite (DB2, LOW);
  digitalWrite (DB3, LOW);
  digitalWrite (DB4, LOW);
  digitalWrite (DB5, HIGH);
  digitalWrite (DB6, LOW);
  digitalWrite (DB7, HIGH);

  digitalWrite(WR, 1);
  delayMicroseconds(250);
  digitalWrite(WR, 0);
}

expecting an A but instead got nothing, what does write strobe do?
« Last Edit: August 10, 2017, 01:12:32 am by neo »
A hopeless addict (and slave) to TEA and a firm believer that high frequency is little more than modern hoodoo.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf