Author Topic: Vacuum fluorescent display to clock display  (Read 50658 times)

0 Members and 1 Guest are viewing this topic.

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: Vacuum fluorescent display to clock display
« Reply #150 on: October 16, 2016, 05:47:04 am »
i have a common anode 7 segment + dp display hooked up with 1k resistors before and after (1.2k +-20% their what i had at hand) and arduino with spi is what i thought i was meant to be learning
« Last Edit: October 16, 2016, 06:03:45 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: 12864
Re: Vacuum fluorescent display to clock display
« Reply #151 on: October 16, 2016, 06:36:46 am »
Great.  I was asking about switches etc. in case you needed something simpler as a 'baby step' on your way to Arduino SPI. 

As you are going straight to Arduino, hook up the '595 to the Arduino as described in bildr's '595 tutorial and try bit-banging it: http://bildr.org/2011/02/74hc595/
Once you've got that working, we'll move it to the hardware SPI port and try it that way.
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: Vacuum fluorescent display to clock display
« Reply #152 on: October 16, 2016, 07:27:19 am »
i have everything hooked up like you said fo spi, will that be a problem with bit banging and if no why wont his code allow me to change anything (yes the connections are right i changed the code to use the pins i have attached the shift register) Well something changed the leds switched off but i cant switch them on
« Last Edit: October 16, 2016, 07:32:18 am by neo »
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: Vacuum fluorescent display to clock display
« Reply #153 on: October 16, 2016, 07:40:21 am »
now their back on im truly lost, the only thing i can do is turn the on or off by connecting or disconnecting pin 10 to +5v
« Last Edit: October 16, 2016, 07:44:19 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: 12864
Re: Vacuum fluorescent display to clock display
« Reply #154 on: October 16, 2016, 08:05:16 am »
Photo  (or at least a very carefully checked list of what pin is connected to what) and current code please.

There's an Arduino library + sketch and a Windows application that lets you toggle pins directly from a Windows GUI.  It *may* be helpful to debug your hardware.

Do you have a logic probe that can indicate High/Low/Tristate?  If not, do you have a CMOS 4001 chip?  There's a reasonably simple logic probe here: http://www.zen22142.zen.co.uk/Circuits/Testgear/lprobe.htm  that's worth building to help debug this sort of stuff.

Alternatively do you have an Oscilloscope?
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: Vacuum fluorescent display to clock display
« Reply #155 on: October 16, 2016, 08:22:24 am »
oscilloscope yes, a Hitachi V-1065A (if the model matters for whatever reason)

A-1.2kOhm-15
B-1.2kOhm-1
C-1.2kOhm-2
D-1.2kOhm-3
E-1.2kOhm-4
F-1.2kOhm-5
G-1.2kOhm-6
H-1.2kOhm-7
GND-8
+5V-16
Arduino11 - 595,14
Arduino10 - 595,12
Arduino13 - 595,11

595,10
595,13
595,14 all NC
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: Vacuum fluorescent display to clock display
« Reply #156 on: October 16, 2016, 08:30:43 am »
current code
Code: [Select]
$b = "
int SER_Pin = 11;   //pin 14 on the 75HC595
int RCLK_Pin = 10;  //pin 12 on the 75HC595
int SRCLK_Pin = 13; //pin 11 on the 75HC595

//How many of the shift registers - change this
#define number_of_74hc595s 1

//do not touch
#define numOfRegisterPins number_of_74hc595s * 8

boolean registers[numOfRegisterPins];

void setup(){
  pinMode(SER_Pin, OUTPUT);
  pinMode(RCLK_Pin, OUTPUT);
  pinMode(SRCLK_Pin, OUTPUT);


  //reset all register pins
  clearRegisters();
  writeRegisters();
}               


//set all register pins to LOW
void clearRegisters(){
  for(int i = numOfRegisterPins - 1; i >=  0; i--){
     registers[i] = HIGH;
  }
}


//Set and display registers
//Only call AFTER all values are set how you would like (slow otherwise)
void writeRegisters(){

  digitalWrite(RCLK_Pin, LOW);

  for(int i = numOfRegisterPins - 1; i >=  0; i--){
    digitalWrite(SRCLK_Pin, LOW);

    int val = registers[i];

    digitalWrite(SER_Pin, val);
    digitalWrite(SRCLK_Pin, HIGH);

  }
  digitalWrite(RCLK_Pin, HIGH);

}

//set an individual pin HIGH or LOW
void setRegisterPin(int index, int value){
  registers[index] = value;
}


void loop(){

  setRegisterPin(1, HIGH);
  setRegisterPin(2, HIGH);
  setRegisterPin(3, HIGH);
  setRegisterPin(4, HIGH);
  setRegisterPin(5, HIGH);
  setRegisterPin(6, HIGH);
  setRegisterPin(7, HIGH);
  setRegisterPin(8, LOW);

  writeRegisters();  //MUST BE CALLED TO DISPLAY CHANGES
  //Only call once after the values are set how you need.
}
";
echo $b;
« Last Edit: October 16, 2016, 01:19:47 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: 12864
Re: Vacuum fluorescent display to clock display
« Reply #157 on: October 16, 2016, 09:31:17 am »
Next time, please use code tags when posting code.  The forum swallowed the i subscript of the registers array in  clearRegisters() and writeRegisters(). :( 
Fortunately you didn't use i as a subscript anywhere else so I've been able to recreate the sketch.

A-1.2kOhm-15  ; I assume this is the LED --- '595 wiring
B-1.2kOhm-1
C-1.2kOhm-2
D-1.2kOhm-3
E-1.2kOhm-4
F-1.2kOhm-5
G-1.2kOhm-6
H-1.2kOhm-7
GND-8
+5V-16
Arduino11 - 595,14
Arduino10 - 595,12
Arduino13 - 595,11

595,10
595,13
595,14 all NC ; ?????? you've already listed '595.14 -- Arduino.11

There's a problem with your hookup.  You absolutely cannot leave '595 pins 10 (/MR) and 13 (/OE) floating.  Tie 10 high and 13 low - direct to the 5V and 0V rails is fine.

If you want to check signals with your scope, put a short delay in the loop() to make it easier to spot the beginning of each transfer.  delay(2); should be suitable.
Set it to 0.2V/cm and use x10 probes. (If you don't have any x10 capable probes, get a pair! Meanwhile tell me what probes you do have.)

Start by probing SRCLK_Pin and RCLK_Pin, one on each channel of your scope, triggering on RCLK_Pin -ve edge. You should see eight low-going pulses on  SRCLK_Pin nicely framed by the low time of RCLK_Pin.

Then try probing the SRCLK_Pin  and SER_Pin signals. Try triggering on SRCLK_Pin -ve edge and adjust the timebase and holdoff to get a stable display with eight low going pulses of SRCLK_Pin on the screen.  You should be able to see each data bit in sequence on SER_PIN.
« Last Edit: October 16, 2016, 09:48:49 am by Ian.M »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: Vacuum fluorescent display to clock display
« Reply #158 on: October 16, 2016, 10:21:09 am »
I've hacked my VFD board to simulate your one digit common anode LED hookup by disconnecting the PWM dimming signal and grounding /MR of the second 74HC595 so all the digit grids are on and as a result found another bug in the code.  The register pin numbers start from 0 not 1.  Try replacing your loop() with:
Code: [Select]
void loop(){

  // Display segments for "3"
  setRegisterPin(0, LOW); //a
  setRegisterPin(1, LOW); //b
  setRegisterPin(2, LOW); //c
  setRegisterPin(3, LOW); //d
  setRegisterPin(4, HIGH); //e
  setRegisterPin(5, HIGH); //f
  setRegisterPin(6, LOW); //g
  setRegisterPin(7, HIGH); //d.p.

  writeRegisters();  //MUST BE CALLED TO DISPLAY CHANGES
  //Only call once after the values are set how you need.
  delay(2);
}
Remember for common anode displays, LOW = ON ;)
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: Vacuum fluorescent display to clock display
« Reply #159 on: October 16, 2016, 12:44:30 pm »
For your amusement, I've rewritten it to use packed bits in the registers array.  It now only needs one byte per '595 chip.  I've also fixed the inverted logic problem - #define ON and OFF correctly as HIGH and LOW or visa-versa and it sorts it out for you.
Code: [Select]
const uint8_t SER_Pin = 11;   // MOSI - pin 14 on the 75HC595, data in
const uint8_t RCLK_Pin = 10;  // /SS  - pin 12 on the 75HC595, store clk 
const uint8_t SRCLK_Pin = 13; // SCLK - pin 11 on the 75HC595, shift clock

//How many of the shift registers - change this
#define number_of_74hc595s 1
#define ON LOW
#define OFF HIGH

//// uncomment for Ian's segment ordering
//#define SCRAMBLE
//const uint8_t scramble[]={ 6,5,4,3,2,1,0,7 };  //Map Neo's segment order to mine.

//do not touch
#define numOfRegisterPins number_of_74hc595s * 8

uint8_t registers[number_of_74hc595s];

void setup(){
  // Setup pins as output
  pinMode(SER_Pin, OUTPUT);
  pinMode(RCLK_Pin, OUTPUT);
  pinMode(SRCLK_Pin, OUTPUT);

  //reset all register pins
  clearRegisters();
  writeRegisters();
}               


//set all register pins to OFF
void clearRegisters(){
  for(uint8_t i = 0; i<sizeof(registers); i++){
     registers[i] = OFF?0xFF:0;
  }
}


//Set and display registers
//Only call AFTER all values are set how you would like (slow otherwise)
void writeRegisters(){

  digitalWrite(RCLK_Pin, LOW);

  for(uint8_t i = sizeof(registers); i--;){ //loop from N-1 to zero inclusive
     uint8_t t=registers[i];
     for(uint8_t j = 8; j--;){ 
       digitalWrite(SRCLK_Pin, LOW);
   
       // // Extract bit value and output the simple way
       // bool val = !!(t&128);
       // digitalWrite(SER_Pin, val);
       
       // Extract bit value and output the fast way
       if(!!(t&128)) digitalWrite(SER_Pin, HIGH); else digitalWrite(SER_Pin, LOW);
       //delayMicroseconds(10); // dont exceed 100 KHz!   
       digitalWrite(SRCLK_Pin, HIGH);
       t<<=1; //shift to next bit.
     }
  }
  digitalWrite(RCLK_Pin, HIGH);

}

//set an individual pin HIGH or LOW
void setRegisterPin(uint8_t index, bool value){
   const uint8_t BitMasks[]={1,2,4,8,16,32,64,128}; // convert bit position to single '1' mask

   #ifdef SCRAMBLE
     index=(index&0xF8)|scramble[index&7];
   #endif
  if(value) registers[index>>3]|=BitMasks[index&7]; else registers[index>>3]&=~BitMasks[index&7];
}


void loop(){

  // Display segments for "3"
  setRegisterPin(0, ON); //a
  setRegisterPin(1, ON); //b
  setRegisterPin(2, ON); //c
  setRegisterPin(3, ON); //d
  setRegisterPin(4, OFF); //e
  setRegisterPin(5, OFF); //f
  setRegisterPin(6, ON); //g
  setRegisterPin(7, OFF); //d.p.

  writeRegisters();  //MUST BE CALLED TO DISPLAY CHANGES
  //Only call once after the values are set how you need.
  delay(2);
}
Sketch is called 'Neo1e'.

I'm also using C99 fixed width integer types (from stdint.h) for brevity and efficiency - you'll need an OPTIONAL patch for keywords.txt if you want the IDE's syntax hilighting to support them. 
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: Vacuum fluorescent display to clock display
« Reply #160 on: October 16, 2016, 01:15:14 pm »
Quote
595,14 all NC ; ?????? you've already listed '595.14 -- Arduino.11

im not immune to typos or mistakes, trouble is i tried that way with them as you said and it did nothing, perhaps the resistance is too high?
« Last Edit: October 16, 2016, 01:23:27 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: 12864
Re: Vacuum fluorescent display to clock display
« Reply #161 on: October 16, 2016, 01:31:00 pm »
Leaving them floating is *NOT* an option.  *ALL* inputs of any CMOS logic chip that doesn't have built in pullups must *ALWAYS* be tied to a valid logic level.  /OE must be low to enable the '595 outputs and /MR must be high to prevent the shift flipflops all being forced to '0'.

The problem with bringing up something like a '595 for the first time is you have to get the connections and the signal sequence all right together, and if its not working you cant easily tell what's wrong without a scope and advance knowledge of what the signals are supposed to look like

If you are still stuck, post a GOOD photo of your breadboard + Arduino.  I need to be able to zoom it in enough to see resistor colour codes and which wire goes into which hole so make sure its in sharp focus, keep the resolution above 1000 px on the short side and don't over-compress it
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: Vacuum fluorescent display to clock display
« Reply #162 on: October 16, 2016, 01:40:25 pm »
i warn you my camera sucks and this forum wont let it upload in 4k, also the trouble with my oscilloscope is its analog and so it would be a real headache to drag it in here but i can use it if i have to, i tried it with a 200 ohm same result. This is turning into a real headache
« Last Edit: October 16, 2016, 01:42:30 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: 12864
Re: Vacuum fluorescent display to clock display
« Reply #163 on: October 16, 2016, 01:53:02 pm »
That's not in focus.  Try backing off a bit to give its autofocus a chance.  You may need to use the camera zoom to fill the field of view but using zoom requires very good lighting.  Also the Arduino isn't in shot so I cant trace the wires. Contrast, lighting and image size are good, so if you can sort out the focus (I should be able to read the part no. on the bottom chip) I can check your circuit.

However I note you don't have any decoupling for the '595.  Add a 0.1uF disk ceramic or similar directly across the top of the chip between pins 8 and 16.  Without it, any noise on the supply or long supply wires will make its behaviour unpredictable.
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: Vacuum fluorescent display to clock display
« Reply #164 on: October 16, 2016, 01:56:21 pm »
i cannot take a better picture i am sorry the bottom chip is for a later stage sn74ls155n the only thing connected is the 595
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: 12864
Re: Vacuum fluorescent display to clock display
« Reply #165 on: October 16, 2016, 02:16:25 pm »
Its difficult to tell due to the camera angle (straight down or slightly side on is far better than an end-on  tilted view when one is trying to check breadboard wiring)  and the focus problem, but it looks fairly sane.  Of course I cant check the Arduino wiring as its out of frame and you haven't told me what colour the Arduino pins 13, 11 and 10 wires are.

You MUST connect the Arduino GND to breadboard GND/Vss/0V.  I cant see that connection in the photo.  If that doesn't fix it, scope the three signals keeping the arduino.13 signal on one channel all the time and swapping between the other two as I described above, probing right at the '595's pins, (and clip the ground lead on as close to pin 8 of the '595 as you can) then post photos of the traces.

Check the probes are properly compensated using the scope's squarewave calibrator output before scoping the signals. Adjust the probes' compensation trimmers if the leading edge of the squarewave overshoots or undershoots significantly. When taking scope screen shots, shade the screen from ambient light as much as possible, make sure the brightness isn't too high so the spot doesn't flair, and preferably use a mini-tripod or a pile of books to avoid camera shake.  When posting scope shots, always describe the gain setting for each input used, (V/div), note whether the probes where x1 or x10 etc. and give the timebase setting.
« Last Edit: October 16, 2016, 02:30:27 pm by Ian.M »
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: Vacuum fluorescent display to clock display
« Reply #166 on: October 16, 2016, 02:27:42 pm »
yellow green yellow white, gnd 13 12 11
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: Vacuum fluorescent display to clock display
« Reply #167 on: October 16, 2016, 02:32:24 pm »
i got a question, forgive me if its dense but i have seven 7407 hex buffer chips, what is stopping me from just using these and code i can understand to drive the display? as i understand it the 7407 could be made to output 30v though im a bit fuzzy on how
« Last Edit: October 16, 2016, 02:40:32 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: 12864
Re: Vacuum fluorescent display to clock display
« Reply #168 on: October 16, 2016, 03:02:45 pm »
The limitation was the Arduino's number of I/O pins.   D0 - D13 + A0 - A5 only gives you 20 pins.  IIRC, your VFD has 6 digits and 14 segments per digit, so if you drive the 7407 chips directly  from the Arduno you wont have any pins left to connect any buttons to control the clock or to connect a RTC chip (since the onboard resonator is so crappy).   You need to free up an absolute minimum of three pins, A4 and A5 because you need the I2C pins for a RTC chip and one other analog pin for a resistor ladder with all the buttons.  That could be done by using a 74xx238 chip to convert a three bit binary number into up to 8 digit select signals, but adding an alarm output would then be extremely difficult.

The pin shortage problem mostly goes away if you wire your VFD as if it was a 7 segment one, paralleling the two center horizontal segments, and grounding the unused radial segments. 

 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: Vacuum fluorescent display to clock display
« Reply #169 on: October 16, 2016, 03:06:23 pm »
can the arduino program micro controllers bigger than it? if so i could just use a gigantic micro or maybe two smaller ones if it couldn't
« Last Edit: October 16, 2016, 03:35:08 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: 12864
Re: Vacuum fluorescent display to clock display
« Reply #170 on: October 16, 2016, 03:45:53 pm »
Yes, mostly Atmel chips + a few others.  A reasonable option would be to use it to flash a 40 pin ATmega1284P with an Arduino compatible bootloader, then connect it to the IDE using a FTDI serial cable as-if it was an Arduino.   There's an article here: https://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/
 

Offline Rolo

  • Regular Contributor
  • *
  • Posts: 206
  • Country: nl
Re: Vacuum fluorescent display to clock display
« Reply #171 on: October 16, 2016, 04:00:51 pm »
Or Arduino Mega, lots of I/O and default supported in IDE.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: Vacuum fluorescent display to clock display
« Reply #172 on: October 16, 2016, 08:02:11 pm »
The ATmega1284P PDIP chip is a heck of a lot cheaper than a genuine Mega, even if you add on the cost of a 16MHz crystal.  Its also easier to breadboard with.   If you are too cheap to get a USB<=>logic level serial cable, once youv'e stuffed a bootloader in there, you could even use a Uno with RESET tied low and tap its RX and TX pins to the equivalent pins on the  PDIP, then pulse its RESET low manually to trigger the bootloader.

See http://www.hobbytronics.co.uk/arduino-uno-pro-1284p for ones with a preloaded bootloader + more up to date resources for adding it to the IDE etc.

OTOH Chinese Arduino Mega clones are cheap as chips . . . .
 

Offline neoTopic starter

  • Super Contributor
  • ***
  • Posts: 1694
  • Country: us
  • The specialist.
Re: Vacuum fluorescent display to clock display
« Reply #173 on: October 16, 2016, 11:17:22 pm »
im pretty sure i have old crystal oscillators about that speed if i do couldn't i use them? also does the chip need an arduino bootloader on it? also the main reason to go with a chip versus the mega is this does plan to be buried in a clock
« Last Edit: October 16, 2016, 11:27:35 pm by neo »
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: Vacuum fluorescent display to clock display
« Reply #174 on: October 16, 2016, 11:41:40 pm »
it is confirmed i have a 16megahertz crystal oscillator from 1984 (not sure if it works but the previous owner kept it put up so i fail to see why it wouldnt)
« Last Edit: October 16, 2016, 11:43:51 pm 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