Hello all,
I've been butting my head up against this for a bit and am feeling pretty clueless.
I'm trying to get an old VFD working, and that VFD uses an NEC uPD6323BC 21-bit shift register to control the elements. So, thinking I was smart, I figured I would use the Arduino to control input to the Clock, Serial Input, and Latch pins of that board.
I've tried both setting up and running "SPI" as well as using serial with "shiftOut", but I get pretty much the same problem on each one. No matter what data I send it, it seems to illuminate multiple elements with no particular correlation to each other. They're not random as they're repeatable (if I send "1" over and over the same elements illuminate.), but they're really all over the place. The good news is it seems I'm actually successfully sending data as I get life out of the board and elements illuminating. Also, if I send "0" all elements turn off as expected.
There are 19 elements, and the 21-bit register implies to me that each bit controls an individual element, but even when sending just "1", it seems to illuminate multiple elements. I've tried typing in a 21-digit binary number to send, I've tried Hex and even just counting up an int, like in my code example below.
I don't know enough about serial communication to know if I'm doing something obviously and painfully wrong. I feel like I'm not sending enough bits to fill the full register and multiple bits are getting stacked on top of each other or something.
Here's the datasheet for the shift register: Datasheet
Here's a few pictures from the datasheet that better illustrate what I'm trying to achieve.
Pic 1: This one I can follow pretty easy, the concept is simple enough.
Pic 2: This is the program example. Only problem is, I have no idea what half the abbreviations mean...
If anyone could just give me a nudge in the right direction, that'd be amazing!
Thanks all,
David
Here's my code. It's pretty much a simple trial and error test program.
#include <SPI.h>
const int latchHold = 10;
const int dataOut = 11;
const int sClock = 13;
void setup() {
Serial.begin(9600);
SPI.begin ();
pinMode (dataOut, OUTPUT);
pinMode (sClock, OUTPUT);
pinMode (latchHold, OUTPUT);
}
void loop() {
for (int i = 1; i < 256; i++) {
//shiftOut(dataOut, sClock, LSBFIRST, i);
digitalWrite(latchHold, LOW);
SPI.beginTransaction(SPISettings(2000000, LSBFIRST, SPI_MODE1));
SPI.transfer(0);
SPI.transfer(i);
SPI.endTransaction();
digitalWrite(latchHold, HIGH);
digitalWrite(latchHold, LOW);
delay(1000);
}
}

