Fema 14-segment alphanumeric display modules Code

I have 5 Fema 14-segment alphanumeric display modules p/n AI20-054SH-LRR-L5.5Z that contains 35 bit shift register. The problem I am having is figuring out how to send data to it via serial.
Here is a code that I found to transmit serial data to the display.


//pin definitions, using the shiftOut function to communicate with the display
const int SDATA = 12;   //to SIN on JP1     
const int CLOCK = 11;   //to CLK on JP1
const int LATCH = 10;   //to LAT on JP1
const int BLANK = 9;  //to BL  on JP1

//BL pin on JP1 MUST be pulled LOW, we will do this in software
//Display brightness can also be controlled through PWM using AnalogWrite function

void setup () {
  
  //set all pins to output
  pinMode(SDATA, OUTPUT);    
  pinMode(CLOCK, OUTPUT);
  pinMode(LATCH, OUTPUT);
  pinMode(BLANK, OUTPUT);
  digitalWrite(BLANK, LOW); //for this example, BLANK is held LOW throughout
  
  //allow DSP-0801's onboard PIC to wake up before sending any data
  delay(500);                
  
   //send 8 blank digits to clear all registers, not always necessary but good practice
   for(int i = 0; i < 8; i++) {                  
    digitalWrite(LATCH, LOW);
    shiftOut(SDATA, CLOCK, MSBFIRST, 0x0000);    //data must be sent one byte at a time
     shiftOut(SDATA, CLOCK, MSBFIRST, 0x0000);
    digitalWrite(LATCH, HIGH);
  }
  
}


void loop () {
  
    //defines how fast digits will scroll
    int scrollRate   = 200;      
    
    //character table array - what we want to put on the display goes in here, in this
    //case:
    //"DSP0801 THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG    "
    //refer to 14-segment character code document for HEX values
    
    word charTable[55] = {
    0x0200, 0x909,  0x00F3, 0x243F, 0x00FF, 0x243F, 0x406,  0x0000,
    0x1201, 0x00F6, 0x0079, 0x0000, 0x83F,  0x003E, 0x1209, 0x0039, 0xC70,
    0x0000, 0x00BF, 0x8F3,  0x003F, 0x2A36, 0x936,  0x0000,
    0x0071, 0x003F, 0x2D00, 0x0000, 0x001E, 0x003E, 0x1536, 0x00F3, 0x909,
    0x0000, 0x003F, 0x2430, 0x0079, 0x8F3,  0x0000, 0x1201, 0x00F6, 0x0079,
    0x0000, 0x0038, 0x00F7, 0x2409, 0x1500, 0x0000, 0x120F, 0x003F, 0x00BD,
    0x0000, 0x0000, 0x0000, 0x0000 
    };                                                                      
                                                                            
  //get characters from array one at a time ready to be shifted out
 
  for(int index = 0; index < 1; index++){                                   
  word charData =  0x3f00; //charTable[index];
  
  //shift out the value currently held in charData
  digitalWrite(LATCH, LOW);
   shiftOut(SDATA, CLOCK, MSBFIRST, (charData >> 8));  //send one byte
  shiftOut(SDATA, CLOCK, MSBFIRST, charData);         //then the other 
  digitalWrite(LATCH, HIGH);
  delay(scrollRate);
  
  }
   
  
}

I try to work out a data table for it and not having much luck spent 3 hours searching on the web for information.
here is the Serial Data input sequence.


I can activate Segment A-E but when I try to activate F to make a zero segment G lite instead. If anyone has suggestion please let me know.

Thanks
I will still search the internet for answer.

Hello,

Because shiftOut will send 8 bits, I think that you have to send 40 bits of data (5 bytes), with the 5 first bits being unused because they will be discarded by the 35 bits shift register

I would go back to a very basic analysing how the shift-register works.
With this I mean a small testprogram just shifting out a single bit
one bit one clock-signal and then giving the latch-signal to transfer the bit into the output-stage and observe which element does light up.

a single bit and two clock-signals and then latch-signal
a single bit and three clock-signals and then latch-signal
....
a single bit and 14 clock-signals and then latch-signal
always noticing which element lights up.

I have never seen a 35bit shiftregister before.

Can you provide a datasheet of this module?

best regards Stefan

When you send 0x3F00 (0b0011111100000000) what segments light up? Are there 6 lit?

I get garbage I have a program I did using a MicroChip pic chip that did serial output that I am going to rewrite for the Uno board. I will keep you posted.

Are you saying that the pattern of lit segments is constantly changing?!?

the pattern stays the same with wrong segments displaying. I wish the Arduino IDE could do debugging. The visual code worked great until they did update and now I spend to much time trying to get it to work right.

Try this

digitalWrite(LATCH, LOW);
shiftOut(SDATA, CLOCK, LSBFIRST, 0b00000000);
shiftOut(SDATA, CLOCK, LSBFIRST, 0b00000000);
shiftOut(SDATA, CLOCK, LSBFIRST, 0b00000000);
shiftOut(SDATA, CLOCK, LSBFIRST, 0b11110000);
shiftOut(SDATA, CLOCK, LSBFIRST, 0b00000000);
digitalWrite(LATCH, HIGH);

Which segments are ON ? S2, T2, A1 and B1 ?

That's why I asked, "what segments light up?" Knowing which segments light up can help determine the data format.

I'd write a sketch to send 40 bits (5 bytes) and use Serial to send the number of a single bit to light up. It shouldn't take long to figure out which bits go with which segments.

In fact, here is such a sketch:

//pin definitions, using the shiftOut function to communicate with the display
const int SDATA = 12;   //to SIN on JP1
const int CLOCK = 11;   //to CLK on JP1
const int LATCH = 10;   //to LAT on JP1
const int BLANK = 9;  //to BL  on JP1

//BL pin on JP1 MUST be pulled LOW, we will do this in software
//Display brightness can also be controlled through PWM using AnalogWrite function

void setup ()
{
  Serial.begin(115200);
  delay(200);
  
  //set all pins to output
  pinMode(SDATA, OUTPUT);
  pinMode(CLOCK, OUTPUT);
  pinMode(LATCH, OUTPUT);
  pinMode(BLANK, OUTPUT);
  digitalWrite(BLANK, LOW); //for this example, BLANK is held LOW throughout
}

byte Data[5];

void loop ()
{
  int bitIndex, byteIndex;

  if (Serial.available())
  {
    bitIndex = Serial.parseInt();

    // Clear any trailing characters from the buffer
    while (Serial.available())
    {
      Serial.read();
      delay(100);
    }

    // Check that the value is valid
    if (bitIndex < 0 || bitIndex >= 40)
    {
      Serial.println("Enter an index from 0 to 39");
      return;
    }
      
    byteIndex = bitIndex / 8;
    bitIndex = 0x80 >> (bitIndex % 8);

    // Clear the buffer
    for (int i = 0; i < 5; i++)
      Data[i] = 0;
      
    // Set the specified bit (left to right)
    Data[byteIndex] = bitIndex;

    // Send the buffer
    for (int i = 0; i < 5; i++)
    {
      digitalWrite(LATCH, LOW);
      shiftOut(SDATA, CLOCK, MSBFIRST, Data[i]);
      digitalWrite(LATCH, HIGH);
    }
  }
}

Thanks Johnwasser for the suggestions.I will give it a try didn't think to use the serial. I hooked up the scope to see what my clock and data was doing for the shiftOut the clocking would only run for 8 bits then stop. Using a PIC hip I was able to get the display top work right by using the Carry bit in the register to send out the serial data.` Here is the code I did using the pic chip

if (CARRY == 1){
	Data_Out = 1;
	__delay_us(250);
    Clk = 1;
}
 if (CARRY == 0){		 	  
	Data_Out = 0;	
		__delay_us(250);
	   Clk = 1;
}

That's what shiftOut() does. It shifts out one byte (8 bits). That's why I used 5 bytes (40 bits) to allow you to set any of the 34 segment pins.

I just found out the data sheet was wrong it shows the enable input is active high on the datasheet instead of active low. I called the company because it says one thing but the timing data was different. They sent me an updated data sheet which made more sense. Thanks for you help and I learned from your help. Once again thanks.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.