Shop OBEX P1 Docs P2 Docs Learn Events
TTL / LED Light Show — Parallax Forums

TTL / LED Light Show

MaKRMaKR Posts: 2
edited 2008-04-09 14:36 in BASIC Stamp
I am a 1st year SCADA student at a local tech school. We use the Board of Education / BS2 in class. As a semester project I am trying to reinvent the hypnocube [noparse][[/noparse]see http://www.hypnocube.com]. My main components in order from positive to negative are:

BS2 Microcontroller [noparse][[/noparse]positive outputs] -> LS7409 AND Gates -> LS74374 D-type Flip Flops -> large 'cube' of LED's [noparse][[/noparse]single color, 5 x 5 x 4, as opposed to the original hypnocube which is tri-color 4 x 4 x 4] -> 1N4148 rectifier diodes -> neg activated pins of BS2

I also use a separate 5V power supply in case of higher current. The trick is running 25 + and 4 - on a 15 pin board. When 2 columns and 2 rows are on at the same time, 4 lights turn on even if you only want 2. The way around it is to pulse the pins in succession and repeat a variable amount of times to control how long that part of the pattern is lit.

for time = 1 to (number to control duration, will vary depending on how much code is inside the loop)
assign x or a range for x with for statement
low x
assign y or a range for y
use y to determine y1 and y2
high both y1 and y2
high clock
low y1 and y2
low clock
next
high x <-- seems odd to send positive to the cathode of an LED, but there is no turning pins off once they're activated - only high and low; this causes a lot of interference so we use rectifier diodes to only allow the signal to go the direction we want, and the positive voltage blocks the return path

The 8 positive pins (8-15) control the AND gates - pin 8 + pin 9 = output 1; pin 8 + pin 10 = output ; pin 9 + pin 10 = output 8, all the way to pin 12 + pin 15 = 25, then pin 7 is the clock, pins 0-3 control the cathodes, and pins 4-6 may be used for inputs later or left alone. There are also unused pins on the AND gates and flip flops. The trouble I'm having is the AND gates seem to be only allowing input a to pass and cycling b during a debug pause I put in. This is very odd since the flip flops should prevent that. The initial purpose of flip flops is to extend the hold time so the LED's appear brighter. Finally, here's the history of how the project was built from ground up:

-built the cube itself soldering all cathodes on a row together, all anodes in a column together
-ran 8 columns and 4 rows off the board only, no AND gates or flip flops, then added flip flops
-ran 5 positive pins, 8 AND gates [noparse][[/noparse]2 chips], 8 flip flops [noparse][[/noparse]1 chip], and a 7-seg that displayed a pattern with code similar to:

do
for y1 = 11 to 14
for y2 = (y1 + 1) to 15
high y1
high y2
high clock
low y1
low y2
low clock
next
next
loop

The schematic, pictures, and actual code is at ftp://66.231.16.52/LEDcube if anyone has a clue what is wrong with this schematic. The only thing I thought of was there might need to be diodes on all the AND gate inputs, and I hoped not because that's 56 diodes, but the 7-seg test passing proves the AND gates worked without the diodes. Anyways, help would be greatly appreciated.

Thanks,
MaKR
======================================================================
The New Testament offers the basis for modern computer coding theory,
in the form of an affirmation of the binary number system.

But let your communication be Yea, yea; nay, nay: for
whatsoever is more than these cometh of evil.
-- Matthew 5:3

Post Edited (MaKR) : 3/28/2008 2:25:31 PM GMT

Comments

  • MaKRMaKR Posts: 2
    edited 2008-04-09 14:36
    Just imagine in that mess of wiring I actually had 4 wires out of place....· hmmm...........· Anyways, the program to cycle all LED's works perfectly, but the program to select individual lights from (x, y) coordinates does not.· x is a number 0 to 3 (pins on board), and y is from 1 to·25 (or 0 to 24 if you'd rather start there, but this does not correspond directly to pins), and from y we can figure y1 and y2 which control the pins themselves which are duplexed by AND gates.· I have tried a select / case statement based on a range of numbers grouping them·by y1, but have not been able to successfully run that.· here is the code as is if anyone knows how to correct what I am trying to do:

    FOR x = 0 TO 3
    LOW x
    · FOR y = 1 TO 25
    ··· LOW (y1 + Clock)
    ··· LOW (y2 + Clock)
    ··· SELECT y
    ····· CASE 1 TO 7
    ······· y1 = 1
    ······· y2 = y·- 1
    ····· CASE 8 TO 13
    ······· y1 = 2
    ······· y2 = y - 5
    ····· CASE 14 TO 18
    ······· y1 = 3
    ······· y2 = y - 10
    ····· CASE 19 TO 22
    ······· y1 = 4
    ······· y2 = y - 14
    ····· CASE 23 TO 25
    ······· y1 = 5
    ······· y2 = y - 17
    ··· ENDSELECT
    ··· HIGH (y1 + Clock)
    ··· HIGH (y2 + Clock)
    ··· HIGH Clock
    ··· PAUSE 300
    ··· LOW clock
    · NEXT
    HIGH x
    NEXT

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The New Testament offers the basis for modern computer coding theory,
    in the form of an affirmation of the binary number system.

    But let your communication be Yea, yea; nay, nay: for
    whatsoever is more than these cometh of evil.
    -- Matthew 5:37
Sign In or Register to comment.