Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

The two 7 segment displays using 4094 and arduino

Status
Not open for further replies.

your1click

Member level 3
Joined
Oct 23, 2012
Messages
65
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Dubai, United Arab Emirates, United Arab Emirates
Activity points
1,689
Two 7 segment display using 4094 and artuino

Hi all,
I tried to use two display interface with 4094 and arduino, how to send data to 4094, I sent 0-9 and its going for both display so how to send separate data for one display only without changing another display value. bellow I have uploaded circuit image file.

2018-03-23 at 10-48-15.png

Here is my code
#include <z7seg_led.h>
#include <SPI.h>

const int CE = 8;
const int OE = 9;
const int sw = 3;
const int sw2 =4;


z7seg_led display(OE, CE);

void setup() {
SPI.begin();
display.begin();
display.set_type(z7seg_led_74hc4094);
display.set_pattern("ABCDEFG."); //
pinMode (sw, INPUT);
pinMode (sw2, INPUT);
}

void loop()
{
int stateButton = digitalRead(sw);
if(stateButton == LOW) { //if is pressed
static int i = 0;

display.begin_transfer();
display.send_digit(i++);
display.end_transfer();

if (i >= 10) {
i = 0;
}

delay(250);

}
else
{
stateButton = digitalRead(sw2);
if (stateButton == LOW) {
static int p = 0;
display.begin_transfer();
display.send_digit(p++);
display.end_transfer();
if (p >=10) {
p = 0;
}
delay(250);
}
}
}

I used two switch and I want to change value from sw to display one value and from sw1 to display two value
but now If i change value its changing both together. so please help me
 

Re: Two 7 segment display using 4094 and artuino

Hi,

I didn't go through your code...

You need to do:
* output CE
* output STB
* output 16 x (data + clock)
* output STB
* output CE
(I said "output" because I don't go through the datasheet if they need to be 1 or 0)
****
Data + clock: waveform and timing according datasheet. The first 8 bits for the upper display, the second 8 bits for the lower display.

Klaus
 

Re: Two 7 segment display using 4094 and artuino

can you tell me in details 8 bits for upper and 8 bits for lower display? and can't I send direct 1,2,3,4,5,6,7,8,9,0 to upper display and lower display ?
coz i used 2 button and how to choose which bits for upper or lower >
 

Re: Two 7 segment display using 4094 and artuino

Hi,

What do you mean with "direct sending"?

4094 is a 8 stage shift register, serial in, parallel out. One data input.
To control the outputs you need to shift 8 bits in...
For two 4094 in series you need to shift 16 bits.

Did you read the datsheet?
Did you understand it´s function?

Klaus
 

Re: Two 7 segment display using 4094 and artuino

Yes I read it, and direct sending mean, I sent data 0-9 it's working for single display and now I added another display and I sent data 0-9 its showing in both display. now I gave a name display1 and display2. and display1=value; display2= value. Its showing also but problem is now I want to send value only in display1 so I sent display1=value but that value is showing in both display, which i set value before it replaced by new value. which i didn't gave comment for display2
 

Re: Two 7 segment display using 4094 and artuino

Hi,

another try to explain:

both displays are daisy chained.

Microcontroller --> display1 (8 bits) --> display2 (8 bits)

Thus you need to shift out always informations for both displays. always 2 x 8 bits. always: 8 bit data for display2 then 8 bits for display1

***
If you just shift out 8 bits, then the (previous) contents of the first display are shifted to the second dsiplay.

Klaus
 

Re: Two 7 segment display using 4094 and artuino

You have to shift 16 bits of data say 8 and 9 and then you have to give to latch its output.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top