Offline
Newbie
Karma: 0
Posts: 5
|
 |
« on: January 05, 2013, 04:06:27 am » |
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
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #1 on: January 05, 2013, 04:26:27 am » |
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
God Member
Karma: 8
Posts: 822
ALWAYS ASK FOR THREE. One to use. One to lose. One to abuse.
|
 |
« Reply #2 on: January 05, 2013, 05:32:55 am » |
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/shiftOutSee "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
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #3 on: January 05, 2013, 05:48:59 am » |
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
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #4 on: January 07, 2013, 11:38:02 am » |
Thanks a lot for your help. Now i can write "Hallo"  But now i have the problem that only "o" will be displayed when i use the delay function. My 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
God Member
Karma: 8
Posts: 822
ALWAYS ASK FOR THREE. One to use. One to lose. One to abuse.
|
 |
« Reply #5 on: January 07, 2013, 12:45:15 pm » |
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: 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
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #6 on: January 07, 2013, 02:29:24 pm » |
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
God Member
Karma: 8
Posts: 822
ALWAYS ASK FOR THREE. One to use. One to lose. One to abuse.
|
 |
« Reply #7 on: January 07, 2013, 02:41:39 pm » |
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
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #8 on: January 09, 2013, 08:50:30 am » |
I dont get the 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
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #9 on: January 09, 2013, 03:02:56 pm » |
Thanks for your help Boffin1. when i use this 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 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
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #10 on: January 09, 2013, 03:46:02 pm » |
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.... 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.
|
|
|
|
|