Loading...
Pages: [1]   Go Down
Author Topic: Control 8 x 7 Segment display.  (Read 805 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Guys,

i want to control my  8x 7 Segment display
The display has 5 input pins VCC, GND, DIO, SCK, RCK.
What is the meaning of Pin SCK, RCK?
My Problem is I don’t know how to control the 7 Segment Display.

For example:
I want to count the First Segment from 0-9.

I don’t know how I can access the first 7 Segment Display

Enclosed a pic from my Segments.


Thanks!
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You cant see the chip numbers, but they are likely to be 74HC595 shift registers.

Have a look at http://www.gammon.com.au/forum/?id=11518  from Nick Gammon
Logged

We live in the era of the smart phones and stupid people.

Samplefinger
Offline Offline
God Member
*****
Karma: 8
Posts: 819
ALWAYS ASK FOR THREE. One to use. One to lose. One to abuse.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am going to take a wild guess here and say that is a 595 display just like the last guy.  So it is going to want 64 bits of data for the 64 segments.  Why not read up on ShiftOut and sent it FFFFFFFFFFFFFFFF (64 1 bits).  I bet it illuminates all the segments.  Then work it out which bit maps to what segment.

http://arduino.cc/en/Reference/shiftOut

See "For accompanying circuit, see the tutorial on controlling a 74HC595 shift register." about a page down.

Set latchPin to the Arduino pin you have RCK connected to.
Set clockPin to the Arduino pin you have SCK connected to.
Set dataPin to the Arduino pin you have DIO connected to.
Logged

Latest Sampling Scores: ATXMEGA64A3U-MH x3, ATXMEGA256A3U-MH x3, SST38VF6404-90-5C-EKE x3, SST38VF6402-90-5C-EKE x3, PGA870 x3, THS770006 x3

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use the ShiftOut circuit,  the capacitor on the latch line is wrong and should not be connected.
Logged

We live in the era of the smart phones and stupid people.

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Thanks a lot for your help.

Now i can write "Hallo"  smiley

But now i have the problem that only "o" will be displayed when i use the delay function.

My Code:
Code:
void loop()
{

 digitalWrite(latch,LOW);
  shiftOut(data,clock,MSBFIRST,1);
  shiftOut(data,clock,MSBFIRST,B10001001);
  digitalWrite(latch,HIGH);
  digitalWrite(latch,LOW);
  shiftOut(data,clock,MSBFIRST,2);
  shiftOut(data,clock,MSBFIRST,B10001000);
  digitalWrite(latch,HIGH);
  digitalWrite(latch,LOW);
  shiftOut(data,clock,MSBFIRST,4);
  shiftOut(data,clock,MSBFIRST,B11000111);
  digitalWrite(latch,HIGH);
  digitalWrite(latch,LOW);
  shiftOut(data,clock,MSBFIRST,8);
  shiftOut(data,clock,MSBFIRST,B11000111);
  digitalWrite(latch,HIGH);
  digitalWrite(latch,LOW);
  shiftOut(data,clock,MSBFIRST,16);
  shiftOut(data,clock,MSBFIRST,B11000000);
  digitalWrite(latch,HIGH);
 
  delay(1000);

}

It works fine without delay function.



Logged

Samplefinger
Offline Offline
God Member
*****
Karma: 8
Posts: 819
ALWAYS ASK FOR THREE. One to use. One to lose. One to abuse.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not sure why you are telling your shift register chain to latch before you have all the data out there.  I think by latching it every time with the delay you get the other letters displaying but only for an imperceptable amount of time and then O for a full second.  Without the delay you get all the letters showing for the same imperceptable amount of time but at  a 1/5 duty cycle which is why it works.  Try this, hopefully it works better:

Code:
void loop()
{
  digitalWrite(latch,LOW);
  shiftOut(data,clock,MSBFIRST,1);
  shiftOut(data,clock,MSBFIRST,B10001001);
  shiftOut(data,clock,MSBFIRST,2);
  shiftOut(data,clock,MSBFIRST,B10001000);
  shiftOut(data,clock,MSBFIRST,4);
  shiftOut(data,clock,MSBFIRST,B11000111);
  shiftOut(data,clock,MSBFIRST,8);
  shiftOut(data,clock,MSBFIRST,B11000111);
  shiftOut(data,clock,MSBFIRST,16);
  shiftOut(data,clock,MSBFIRST,B11000000);
  digitalWrite(latch,HIGH);
  
  delay(1000);
}
« Last Edit: January 07, 2013, 12:47:33 pm by JoeN » Logged

Latest Sampling Scores: ATXMEGA64A3U-MH x3, ATXMEGA256A3U-MH x3, SST38VF6404-90-5C-EKE x3, SST38VF6402-90-5C-EKE x3, PGA870 x3, THS770006 x3

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi JoeN,

thanks for the quick answer.

When i use your code only the last Segment is activ ("O" will be shown).

Logged

Samplefinger
Offline Offline
God Member
*****
Karma: 8
Posts: 819
ALWAYS ASK FOR THREE. One to use. One to lose. One to abuse.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi JoeN,

thanks for the quick answer.

When i use your code only the last Segment is activ ("O" will be shown).

Wow, sorry to lead you down the wrong path.  Gotta give that a think, not sure why it would behave that way.  Anyone else have a good idea here?
Logged

Latest Sampling Scores: ATXMEGA64A3U-MH x3, ATXMEGA256A3U-MH x3, SST38VF6404-90-5C-EKE x3, SST38VF6402-90-5C-EKE x3, PGA870 x3, THS770006 x3

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I dont get the

Code:
  shiftOut(data,clock,MSBFIRST,1);
  shiftOut(data,clock,MSBFIRST,B10001001);

I usually take the latch low, then pump through all the Bbytes and take the latch high again.

The bytes will be latched into the right registers...
Logged

We live in the era of the smart phones and stupid people.

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Thanks for your help Boffin1.

when i use this code
Code:
  digitalWrite(latch,LOW);
  shiftOut(data,clock,MSBFIRST,B10101010);
  shiftOut(data,clock,MSBFIRST,B11111001);
  digitalWrite(latch,HIGH);

every second Segment shows "1" this is correct but i want to control every single segment for example the first "1" the second "2" ....

I tried also this code

Code:
  digitalWrite(latch,LOW);
 
  shiftOut(data,clock,MSBFIRST,B10101010);
  shiftOut(data,clock,MSBFIRST,B11111001);
   shiftOut(data,clock,MSBFIRST,B01010101);
  shiftOut(data,clock,MSBFIRST,B10010000);
 
  digitalWrite(latch,HIGH);

Now i see the the other segments I think this is also correct, because i overwrite the first Bytes. I don't know how can i control every single Segment.



Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

 A segment refers to the one line of a 7 segment display ....   you are controlling every one of those individually with the 1s and 0s in the bitmap  B10000000  etc....

Quote
i want to control every single segment for example the first "1" the second "2" ....

If you mean you want the first digit to be "1"  and the second digit to be "2'" then depending on which way they have wired up the segments (  I will assume here a,b,c,d,e,f, dec.pt )

for a "1"  you would shiftout B01100000   ( only segments a and b on )

for a "2"   you would shiftout B110110100   ( only segments a, b d,e, and f on )
Logged

We live in the era of the smart phones and stupid people.

Pages: [1]   Go Up
Print
 
Jump to: