So I apparently purchased one of
these at some point last year and I have no clue as to how to get it working. Can anyone point me in the right direction as to how to connect to a Prop BOE board and which driver I should use from the OBEX? Thanks for the help.
Comments
Try this program and let me know what it looks like on your display.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 '' Pin Assignments SHIFT_REGISTER_DATA = 16 SHIFT_REGISTER_CLOCK = 17 SHIFT_REGISTER_LATCH = 18 DIGITS = 8 MAX_DIGIT_INDEX = DIGITS - 1 SEGMENTS = 8 MAX_SEGMENT_INDEX = SEGMENTS - 1 BITS_TO_SHIFT = SEGMENTS + DIGITS MAX_BIT_INDEX = BITS_TO_SHIFT - 1 PUB Setup '' This method starts in cog #0 '' This method starts one additional cogs (serial driver). '' Presently there are six unused cogs. dira[SHIFT_REGISTER_DATA] := 1 dira[SHIFT_REGISTER_CLOCK] := 1 dira[SHIFT_REGISTER_LATCH] := 1 MainLoop PUB MainLoop | digit, activeBits repeat repeat digit from 0 to MAX_DIGIT_INDEX repeat result from 0 to MAX_SEGMENT_INDEX activeBits := 1 << result ShiftOutDigits(digit, activeBits) waitcnt(clkfreq / 4 + cnt) PUB ShiftOutDigits(digit, activeBits) digit := 1 << digit ' set the digit bit high !digit ' invert the bits (only the digit bit will be low) comment this line out if all but one digit lights digit &= $FF ' only keep lowest 8 bits activeBits |= digit << SEGMENTS ' assuming the digits are the high bits repeat BITS_TO_SHIFT outa[SHIFT_REGISTER_DATA] := activeBits outa[SHIFT_REGISTER_CLOCK] := 1 outa[SHIFT_REGISTER_CLOCK] := 0 activeBits >>= 1 outa[SHIFT_REGISTER_LATCH] := 1 outa[SHIFT_REGISTER_LATCH] := 0We're hoping only one segment lights up at a time but it will probably take a couple attempts to get the display to look the way we want.
Try change the line:
to
Don't change anything else and let me know what the display does.
BTW, Loopy is correct about your display not being a LCD.
Edit: Title changed but posts staying the same!!!
in both versions.
E.g see http://forum.arduino.cc/index.php/topic,16922.0.html
What's not clear is which shift register controls the segments and which controls the digits.
I initially guessed the display was a common cathode display but the video Andy made makes me think it's a common anode.
Shift out 8 zeros followed by 8 ones and record what happens. Do the same with 8 ones followed by 8 zeros. Post the results. One of the two should light one or more segments on some (probably all) of the digits.
This is the part of the code that shifts out the bits.
repeat BITS_TO_SHIFT outa[SHIFT_REGISTER_DATA] := activeBits outa[SHIFT_REGISTER_CLOCK] := 1 outa[SHIFT_REGISTER_CLOCK] := 0 activeBits >>= 1 outa[SHIFT_REGISTER_LATCH] := 1 outa[SHIFT_REGISTER_LATCH] := 0To shift out 8 zeros followed by 8 ones you'd set activeBits to $FF00. To shift 8 ones followed by 8 zeros you'd set activeBits to $00FF (aka 256)
****** NEVER MIND. I see Dwayne has already answered the software part, and the board has the pins labelled.
What do you mean by this? Here is how I have it connected, DIO Pin 0, SCK Pin 1 and RCK Pin 2. I have tried using both 3.3V and 5V on a Boe Board with the same results. Duane had program running on 16,17 and 18 but I changed that.
Google just the 3461 along with LED comes up the jackpot
Then the whole thing could look like this;
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 '' Pin Assignments SHIFT_REGISTER_DATA = 0 SHIFT_REGISTER_CLOCK = 1 SHIFT_REGISTER_LATCH = 2 DIGITS = 8 MAX_DIGIT_INDEX = DIGITS - 1 MAX_DISPLAYABLE = 99_999_999 HIGH_DIGIT_DIVIDER = 10_000_000 SEGMENTS = 8 MAX_SEGMENT_INDEX = SEGMENTS - 1 BITS_TO_SHIFT = SEGMENTS + DIGITS MAX_BIT_INDEX = BITS_TO_SHIFT - 1 SEGMENT_A = 1 << 7 SEGMENT_B = 1 << 6 SEGMENT_C = 1 << 5 SEGMENT_D = 1 << 4 SEGMENT_E = 1 << 3 SEGMENT_F = 1 << 2 SEGMENT_G = 1 << 1 SEGMENT_DP = 1 << 0 VAR long shiftStack[32] long fourDigitNumber byte digitBits[DIGITS] PUB Setup '' This method starts in cog #0 '' This method starts one additional cogs (serial driver). '' Presently there are six unused cogs. cognew(MaintainDigits, @shiftStack) MainLoop PUB MainLoop | digit, activeBits repeat repeat fourDigitNumber from 0 to MAX_DISPLAYABLE waitcnt(clkfreq / 4 + cnt) PUB MaintainDigits | previousFourDigitNumber '' This method runs in its own cog. It will continuously '' display the value of "fourDigitNumber" on the 7-segment display. dira[SHIFT_REGISTER_DATA] := 1 ' direction settings need to be done within cog using the pins dira[SHIFT_REGISTER_CLOCK] := 1 dira[SHIFT_REGISTER_LATCH] := 1 previousFourDigitNumber := $7FFFFFFF ' some impossible number repeat if fourDigitNumber <> previousFourDigitNumber previousFourDigitNumber := fourDigitNumber BustDigits(fourDigitNumber) repeat result from 0 to MAX_DIGIT_INDEX ShiftOutDigits(result, digitBits[result]) PUB BustDigits(numberToDisplay) | divisor numberToDisplay <#= MAX_DISPLAYABLE divisor := HIGH_DIGIT_DIVIDER repeat result from 0 to MAX_DIGIT_INDEX digitBits[result] := bitsInNumber[numberToDisplay / divisor] numberToDisplay //= divisor divisor /= 10 PUB ShiftOutDigits(digit, activeBits) case digit ' convert digit to bit position 0..3: digit := 11 - digit 4..7: digit := 19 - digit digit := 1 << digit ' set the digit bit high !digit ' invert the bits (only the digit bit will be low) comment this line out if all but one digit lights digit &= $FF00 ' only keep top 8 bits activeBits &= $FF ' only keep bottom 8 bits activeBits |= digit ' assuming the digits are the high bits repeat BITS_TO_SHIFT outa[SHIFT_REGISTER_DATA] := activeBits outa[SHIFT_REGISTER_CLOCK] := 1 outa[SHIFT_REGISTER_CLOCK] := 0 activeBits >>= 1 outa[SHIFT_REGISTER_LATCH] := 1 outa[SHIFT_REGISTER_LATCH] := 0 DAT bitsInNumber byte SEGMENT_A | SEGMENT_B | SEGMENT_C | SEGMENT_D | SEGMENT_E | SEGMENT_F '0 byte SEGMENT_B | SEGMENT_C '1 byte SEGMENT_A | SEGMENT_B | SEGMENT_D | SEGMENT_E | SEGMENT_G '2 byte SEGMENT_A | SEGMENT_B | SEGMENT_C | SEGMENT_D | SEGMENT_G '3 byte SEGMENT_B | SEGMENT_C | SEGMENT_F | SEGMENT_G '4 byte SEGMENT_A | SEGMENT_C | SEGMENT_D | SEGMENT_F | SEGMENT_G '5 byte SEGMENT_A | SEGMENT_C | SEGMENT_D | SEGMENT_E | SEGMENT_F | SEGMENT_G '6 byte SEGMENT_A | SEGMENT_B | SEGMENT_C '7 byte SEGMENT_A | SEGMENT_B | SEGMENT_C | SEGMENT_D | SEGMENT_E | SEGMENT_F | SEGMENT_G '8 byte SEGMENT_A | SEGMENT_B | SEGMENT_C | SEGMENT_D | SEGMENT_F | SEGMENT_G '9I have not tested it. It's very unlikely it will work since there are so many things I could have gotten wrong.
In theory, the program will show numbers starting at zero and count up to 99,999,999.
The method "MaintainDigits" should keep the display updated. Any of the other cogs can change the value displayed by changing the value of the global variable "fourDigitNumber".
There isn't any provision for the decimal point.
Your schematic doesn't agree with the one Jordan posted. You assume they would number the displays in a logical order. According to the other schematic, digit #0 is the left most digit of the display on the right. So the digits are numbered 4, 5, 6, 7, 0, 1, 2, 3.
Yes it could, but since Peter seems to have found the data sheet for the display it is simpler to use an ohmmeter to see what output pins on the '595's go to what pins on the displays. That video of the display output was not what I expected to see.
I just went by the schematic Jodan posted. I assumed the anodes were at the top and cathodes at the bottom, but if the datasheet Peter found is correct, then the anodes and cathodes are reversed.
This is an easy fix to the program. In the "ShiftOutDigits" method, add a "not" opperator.
Change:
to
This will reverse the bits and swap the anodes with cathodes.
I did not expect what the video shows. Perhaps try shifting out 16 bits at a time with only two bits high, toggle the load output, pause for one second, then shift the high bits one position and repeat. This might tell us more.
That is, start with a word variable set to 3 and rotate one position each time.
If that doesn't work you can try the attached program. Away from my bench so it is not tested but it should shift 2 consecutive bits through the 16 '595 outputs.
BTW
The program Duane posted in post #4 (video in post #6) turned on all 7 segments and DP sequentially which should tell us something.
Shifting out 8 zeros followed by 8 ones in post #17 turned on 6 of 7 segments starting with segment a off followed by b, c, d, e, f, g, and DP going off. Another clue.
Cannot seem to upload or even see the file as a .spin, .txt, or .zip file so I will post it here.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 ' Pin Assignments Data = 0 Clock = 1 Latch = 2 ' Data to shift out DataBits = 3 VAR word DataOut PUB Main ' Setup I/O pins for output dira [Data] := 1 dira [Clock] := 1 dira [Latch] := 1 ' Main routine DataOut := DataBits repeat ShiftBits ' Output 16 bits to the 2 '595's and display them DataOut <-= 1 ' Shift the data waitcnt(clkfreq / 4 + cnt)' Pause so pattern is visible PUB ShiftBits repeat 16 ' Shift out 16 bits outa [Data] := DataOut outa [Clock] := 1 outa [Clock] := 0 DataOut >>= 1 outa [Latch] := 1 ' Transfer data to the '595 output registers outa [Latch] := 0