Electronics 6 foot long 784 LED Sign - need help.

Discussion in 'Modding' started by bigal, 8 Oct 2004.

  1. theshadow27

    theshadow27 What's a Dremel?

    Joined:
    23 Sep 2004
    Posts:
    616
    Likes Received:
    2
    ok sorry bigal ive been pretty busy latley. although i still havent seen pics of the board :sigh: , its pretty easy to figure out how it works. heres what im gonna say is goin on:

    the 7445, a BCD to decimal converter(4 pins to 10, a big demultiplexer), drives 74LS244, which is a 8 pin (octal) buffer (basicly 8 transistors in one package), and pulls each row low (its a tri-state buffer so it can do that) one at a time.

    each time the control circuty pulls a row low via a BCD (4pin) signal, the (four, im guessing) 74LS164s (a serial to parallal converter -- that is, it takes a string of puleses and a clock line, and turns it into 8 diffrent outputs, high or low, depending on the state of the data line when the clock line pulesed the corisponding input number) set 8 leds at a time to on or off, depending on the serial data they have just got. the control circutry goes down the 1st, then 2nt, then 3rd, then 4th, setting the ouput of the display for that row.

    when the next row is selected, the colum clocking cycle repeats, and in this way for a breief amount of time, every led can be set to on or off. by going thrugh this cycle many times a second, the apeance of a message or pattern can be made.

    this setup allows the 800or so leds to all be controlled via:
    1 data line for 4 chips on 4 boards
    1 clock line for 4 chips on 4 boards
    1 chip select line for each chip on 4 boards 16 total
    4 BCD lines total (shared buss)

    or, you could achieve a higher PWM % by controling each of the 4 segments indivitualy, which would quadrupal your datalines, but if you put a PIC16F84 micro on each board, you could control the whole thing via 1 serial bus.

    because of the antique motherboard in use, i would ditch it total and design another one. they have done the hard work for you, i.e. matrixing the LEDs. heres what you want to do on a mainboard:

    1) have 4 PIC16F84's, one to talk to each of the 4 segments
    2) have 1 PIC16F84 to talk to the 4 segment PICs, and alow you to send in data like:
    [pre]
    1-1010100100100101010010101010101010010101010010010101010101011
    2-1010000100010001010010100101010101010101010100010010101010010
    3-1110010101010101000101010110010101010010101100101010101010010
    [/pre]
    etc... with one bit for each LED, over a serial interface.

    thats all basic stuff, and it allows you to concentrate on the good stuff. in order to make a sign do cool stuff, you need to create a "map" if you will, of what it is going to display. i prefer to do it in binary, to make it easer to visulise. a simple VB program can assist you in turning text into this binary notation. the map should have the width of the sign, and as many lines as you want. once you decide on the size of the map, or if it should be variable size, you need to tell the sign what to put in it. you will have to design a font set, so that when you tell it to display "whats up yall" it can take the ascII charicters and put them in the correct line of the binary map. you also have to code that when you get to the end of the map, to go to the next line. you could also code other charicters, such as #, ~, *, etc, and put that in your font memory.

    font memory... basicly each charicter is a array of binary bytes, or 4 (whatever charicter with) bits. then there is a master look up table, that has the name of the charicter array next to the ascII code assosceated with it. nowadays, you should be able to fit all of your fonts in the master PICs memory, but if you somehow what more, like complex images or watever, you can get external, flash (no power needed) eeprom for dirt cheap. of course, then you would need to progaram a memory access sub, but its not to hard.

    text map... this should be in external EEPROM, and each line should be a new element in a linked list (basic CS). each link should be a 7 item array of 112 bits, each repersenting a row. as each charicter of the message is loaded, a index is incremented, to tell you where the next charicter goes. so the first one will occupy slots 1,2,3,4 and 5 (space), the index is set to 6 so that the next charicter starts at 6. when the index hits 112, a new link is made, the head variable is set to the new link, and the index is cleared. to program graphics, you can do a 1 to 1 shift in shift out of serial data in to the links, one line at a time. after programing is compleate, the number of links gets stored in a varable, and the output starts

    output... most signs have many display modes, such as scroll sideways left or right, scroll up or down, burst, disolve, or no trasition. i will go thrugh each of these.

    first off, a display aray is needed, and it must repersent 1 line. a timer inturupt insures that it is displayed every 10 ms or so
    • scoll sideways: the display array is loaded with the current link (duh). a for loop is created, each time the index is incrimented, you move all the old values over 1 (another for loop) and add a new collum (if you move left and add at the right it goes left, visa versa moves right) from the new link (collum number index). you then wait for the inturupt flag timer2 (speed) to clear, and loop agein. when you get to the end (index 112) of the new link, the full link 2 has been loaded in, and the for loop ends ends
    • scroll up and down: another for loop, but this time you take 7 steps (not 112) and take rows in not collums. but its the same idea
    • burst: the burst effect is created by over writing all on from the middle (loop to 56, x-56, x+56), then overwritng the new line the same way
    • desolve: generate random (x,y) coordentes, and write a on bit for say 1000 itterations. then do the same thing (1500 to ensure compleate overwrite x,y's) ecept write the new line bits (i.e. get data from the new line at the point, and if its off, write 0, on write 1)
    • no transistion: just write all the bits to the display array at the same time, no timer

    with this infistructure, a lot of cool stuff is possable, like inversion (0-1, 1-0) and personlazed effects.

    programing + interface.... the MPU also has to have provisions for keypad data entry (kepad PIC + keypad chip compunicate via serial protocal), computer data entry (same thing with a comp), and eathernet data entry (easy to do, $30). these all must activate a inturpt to send the PIC into data entry mode. you could write software that allows it to display, and edit its current memory, or you could just re enter the entire map every time with no display.

    the software.... i would HIGHLY reccomend that you program this is C++. although it may work, you would probably need 2 or 3 PICs to program it in Pic Basic. and assembly is out of the question, were not just flashing lights here.

    best of luck, and dont be affraid to ask questions :thumb:
     
  2. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    Ok..... uhhhh....right!

    lets start from the top, i thought from, looking at this thing that 74LS244 was the "mother" chip on each segement and 7445N was the row select. anyway, i gather you mean to place a pic on each of the four boards.... that would be impossiable (or at least very hard) since they are sprayed black and would be hard to modify...

    Isnt it possiable using the wires available...

    Programming is my downfall.... I kind of have been trying to ignore it for a long time... I try and read tutorials and my brain switches off..

    I soppose what is needed on the controller board is a MAX232 to interface to the PC, a 5 volt reg to supply power, a EEProm to hold the character sets (does that need to be programmed by me ?) (if so i dont have a programmer) and a couple of PIC16F84's.

    C++ = :waah:

    maby i should just throw this thing in the skip and forget it... :grr:
     
  3. theshadow27

    theshadow27 What's a Dremel?

    Joined:
    23 Sep 2004
    Posts:
    616
    Likes Received:
    2
    thats no good, at least burn out all the LEDs before you throw it out...

    programing is not hard. you just have to think like a computer. then the rest just comes. so... yeah you realy need to learn C. just get a nice sams book or whatever, take your time, i (and prob a bunch of other people here) can anwnser your questions.

    yeah i didnt meen modify the display boards, i ment put the pic controlers on the new mobo board.

    did you folow the line/colum driver logic? or do i need to explain that more? because now its up to you to grab datasheets on each of thos chips, and figure out which pins go to which wires. otherwise, i would haev to go thrugh hundrads of pic of the PBC, and im not exactly feelin that.

    once you get the wires diagramed, you can start on the motherboard. you can prob use 1 PIC 16F84 for the 4 boards (i know i lyed :eeek: ) :
    16 chip select lines = 4->16 pin demultiplexer (4 total)
    1 clock out, 1 I2C clock (2 total)
    1 serial data, 1 I2C data (2 total)
    4 BCD out lines (4 total)
    and that comes to a grand total of 12IO pins, and the 16F84 has 13 :D .

    this controler chip is programed to take 8 words (16 bits each) on the first pulse of the I2C clock. the extra 16 bits (not 112, 128) are for the line number, and brightness, and should have provisions for a test bit that activates all the leds. the 13th line can be used as the inturupt in place of the I2C clock.

    so then all you have to do is have another chip feed it data one line at a time. and thats just easy programing.

    :thumb:
     
  4. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    Ok, heres something i quickly whipped up, is the serial you mentioned here:

    [​IMG]

    for the MAX232 or sign?

    I think i just about get you on all that...i am about to put an order in with rapid (need some supplies again...) so i will get a 232 ( i have 4 16f84s) as well as some stuff for the 5 v reg and what shall i have for the demultiplexor... :idea: If i can get a schematic up i can then build and then start banging my head against the wall programming... :waah:
     
  5. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    Don't bother wasting your time using C, you'll find it a lot easier in the long run to use ASM. It's a very simple language, and it's fully covered in the datasheet for the PIC you use. Debugging is very much simpler, and at least you know what is exactly going on inside the hardware.

    I built a matrix message display from 32 5x7 LED matrix blocks with just a PIC16F870 and some 74HC595's. The assembly code was relatively simple.

    Since the board already as the serial to parallel converters, why not just connect these directly to the PIC?
     
  6. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    these converters being the 74LS164N's ? :confused:
    bearing in mind that these are connected to the 74LS244N on the board... This thing (the whole display) only has 7 wires going into it (data - not power) all except one going to the 244. THat must be able to be connected to the I/O lines of a single pic...

    Do i still need this eeprom thing, and if so what type do you (anyone) reccomend? As well as any other components. :idea:
     
  7. theshadow27

    theshadow27 What's a Dremel?

    Joined:
    23 Sep 2004
    Posts:
    616
    Likes Received:
    2
    are you kidding me :eyebrow: ? writing these programs in C is complicated enugh, without having to worry about where each byte is shifted to :wallbash: ... there would be almost no way to hand code this in 2 pics in ASM... dude what are you smokin?

    ive taken 4 years of AP CS classes, and i have written linked lists in ASM, c++, java, and basic. the control segment is 44 lines of java, 31 lines of c++, 90 lines of basic (121 with no line number indexes) and 604 lines of ASM (754 with backwords tagging). if you want, i can post each of these programs, but i doubt you want to go thrugh six hundred lines of ASM. :thumb:

    and the linked list is just one critical part of the program, thats not including any of the data shifting, line scrolling, eeprom programing, or fancy bells and whistles that would take 1 or 2 lines of C.

    so when you say its easier in ASM :rolleyes: get a clue
     
  8. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    Why would you need two PICs? You may need two if you use C since the compilers will never optimise code like you could when you program ASM yourself. Like I said, I have built a 1120 LED matrix sign with a single 16F870, using only 3 banks of memory, with full scrolling and fading and also with serial interface for your PC. The code is very simple in ASM. All you need to do is create a table of your ASCII characters, plus specials, and then shift them out column by column to the serial to parallel converters. I can't understand why you'd think ASM is so much more difficult???? :confused:

    The whole code was only about 2200 lines long, and most of that is just the ASCII characters/fonts.

    74LS164N's are pretty much the same as the serial-parallel converters that I used. Do you know what pins are connected as inputs from your new controller board?

    I notice you drew a serial interface to the 16F84. Note that the 16F84 has no hardware UART, and while it is pretty simple to code a simplex serial interface in ASM, it will eat up a lot of your processing time. Consider using one of the 16F87X range of PICs.

    You shouldn't need to use any external EEPROM. The 16F87X's have some internal EEPROM, but there shouldn't be too much that you actually need to store in there. Depends if you want to store the message(s) in ASCII in there. The character fonts can be stored in program memory without worry of running out of space.
     
    Last edited: 26 Oct 2004
  9. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    as on the schematic, all the pin 7's (of the 164N's) are joined together and to pin 8 of the 7445N and to pin 16 of the LS244 (as well as one of the input wires) Pins 14 + 8 of the 164N's go to the LS244 as well. the BCD input's to the 7445N come from the LS244, of which has another 5 (of the 7) inputs going to it. so 7 inputs to the display area, all but one going to the LS244 and one of them going to the 164N's (as mentioned at the beggining) :hip:

    2200 lines of ASM code sound like one hell of a lot, how exactley do you go about with this font map thing? :waah: :waah: :rolleyes: stupid code.
     
  10. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    I can get a programmer to program the 16F87 series (as well as others) for about £25 - any good? :worried:

    i hear ASM has only 35 instructions for everything, i am trying to follow a sort of tutorial, but it is hard, my brain keeps giving up... :hip:
     
  11. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    You could use something similar to this for each character.

    This could represent an "S"

    Code:
    	RETLW B'0001110'
    	RETLW B'0010001'
    	RETLW B'0010000'
    	RETLW B'0001110'
    	RETLW B'0000001'
    	RETLW B'0010001'
    	RETLW B'0001110'

    If you want to be cheap you can build your own programmer based on the JDM programmer with icprog as the software.
     
  12. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    ahh slick, i get it now, the binary is the LED bit state and so on. I actually built a JDM programmer and it didnt work.... :waah:
    So i bought a mini thing for £15 off ebay (parrallel job) which workes but only for the ones above, i am thinking of buying one that can program:

    12C508 12C508A 12C509 12C509A 12C671 12C672 12CE673 12CE674 12F629 12F675 16C505 16C554 16C558 16C61 16C62 16C62A 16C62B 16C63 16C61 16C62 16C62A 16C62B 16C63 16C63A 16C64 16C64A 16C65 16C65A 16C65B 16C66 16C66A 16C67 16C620 16C620A 16C622 16C71 16C71A 16C72 16C72A 16C710 16C711 16C712 16C716 16C72 16C72A 16C73 16C73A 16C73B 16C74 16C74A 16C74B 16C745 16C76 16C765 16C77 16C773 16C774 16C83 16C84 16F627 16F627A 16F628 16F628A 16F630 16F648A 16F676 16F73 16F737 16F74 16F747 16F76 16F767 16F77 16F777 16F818 16F819 16F83 16F84 16F84A 16F87 16F88 16F870 16F871 16F872 16F873 16F873A 16F874 16F874A 16F876 16F876A 16F877 18F242 18F248 18F252 18F258 18F442 18F448 18F452 18F458 18F1220 18F1320 18F2220 18F2320 18F4220 18F4320 93LC46B 93C56 93C66 24LC256 24LC515 24C01 24C02 24C04 24C08 24C16

    so its a bit more upmarket :) :hehe: (and its USB) :clap:
     
  13. theshadow27

    theshadow27 What's a Dremel?

    Joined:
    23 Sep 2004
    Posts:
    616
    Likes Received:
    2
    alright stevie -- take this away in asm, but dont come whining to me when its 5000 lines :rolleyes:

    i still say C is faster
     
  14. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    C may well be faster, but in my view assembler is much easier to use, understand and debug.


    How would you go about creating the charactersets in C?
     
  15. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    Which particular pic do you reccomend for this? :confused:

    I just noticed the PIC16F87 has one hell of a lot more I/Os than the 16F84...

    However, are you sure i can fit it all into one PIC16F87 + a MAX232 jobbie... i mean 26 letters x2 (caps) as well as about 15 symbols... (!"£%&*()][{}@/\.,#~:;) i think thats more than 15 but hey.. :idea:

    i can see a good few thousand lines of code there, but i have a plan.. i have a proggie thatll spin out thos charactersets... :D

    [EDIT1]

    looking through ma book here, which MAX chip do i need:

    MAX202CPE
    MAX202ECPE
    MAX202ecpe
    max232acpe
    max232cpe
    max232cse
    :)
    [/EDIT1]
    [EDIT2]
    uhh onto the pic issue again, looking at ma book still, i see PIC16F87x
    x = 0,1,3 or 4 (ad 3A) and what is MSSP?


    HERE:
    LINKIE :hip:

    and what mhz should this run on, i have some 4mhz crystals.. :baby: ganna get some 8's though for another project.. :eek:
     
    Last edited: 27 Oct 2004
  16. theshadow27

    theshadow27 What's a Dremel?

    Joined:
    23 Sep 2004
    Posts:
    616
    Likes Received:
    2
    boolean A[5][7];

    A[5][1] = [0,0,1,0,0];
    A[5][2] = [0,1,0,1,0];
    A[5][3] = [1,0,0,0,1];
    A[5][4] = [1,0,0,0,1];
    A[5][5] = [1,1,1,1,1];
    A[5][6] = [1,0,0,0,1];
    A[5][7] = [1,0,0,0,1];

    however, i would rather have each charicter have a 1/32 of a memory page in a external EEPROM chip (ex 24LC08B, 4x256x8), so that you could change each each one easly and get to it real quick.

    so before you could use it, you would have to set up a boot loader and clock in each charicter into the EEPROM if you dont have a programer.

    and C is deff easier to debug... because it can be compiled on a real computer without a emulator! and easier to use, its like talking english vs talking machine language. more importantly, people have written thousands of librarys for C, so just about anything that you want to do is already done, and you just have to tie them togeter.

    its okay, i apreciate that you think ASM is better, but consider this:
    back in the day, "personal" computers were programed in ASM, then they moved to basic and finaly to high levels like C and JAVA. PICs did the same thing, and theres a reason. when your doing complicated stuff, why do more work when you can do less and make it better?
     
  17. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    so you would need 2 pics, one to program to program the EEPROM and one to run the program :wallbash:

    ASM looks easier to learn (less functions etc) but C looks perhaps more logical.. :rock: (and it sounds cool "I can program in C " - ooohhhh) sort of thing... but anyway. if i can get this thing to work using ASM using one pic and a MAX232 and other bits and bobs i am willing to give it a try.. :baby: But i need a answer the the proble above. :idea: (gotta put an order in) :) thanks guys!
     
  18. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    any answers to the issue here:

    PIC16F87x FLASH microcontroller
    This powerful (200ns instruction execution) yet easy-to-program (only 35 single word instructions) CMOS FLASH-based 8-bit family of micrcontrollers packs Microchips powerful PIC architecture into a standard package that is upward compatible with the PIC16C5x, PIC12Cxxx and PIC16C7x devices. The PIC16F87x features EEPROM data, self programming, an ICD, 10-bit ADC, two additional timers and USART makes these devices ideal for more advanced level A/D applications in automotive, industrial and consumer applications.
    • WDT with on-chip RC oscillator.
    • In-circuit Serial Programming via two pins.
    • Single 5V In-Circuit Serial Programming capability.
    • High sink/source current - 25mA.
    • In-circuit debugging via two pins.
    Show Technical Data:
    Hide Technical Data:

    Device Serial FLASH ADC i/p EEPROM RAM Comms channels Others Package
    PIC16F870-I/SP 2k 128 128 USART 5 DIL28
    PIC16F870-I/SO 2k 128 128 USART 5 SO28
    PIC16F871-I/P 2k 128 128 USART 5 PSP DIL40
    PIC16F873-04/SP 4k 128 192 USART/MSSP 5 DIL28*
    PIC16F873-20/P 4k 128 192 USART/MSSP 5 DIL28
    PIC16F873-20/SP 4k 128 192 USART/MSSP 5 DIL28*
    PIC16F873-20/ISO 4k 128 192 USART/MSSP 5 SO28
    PIC16F873A-I/SP 4k 128 192 USART/MSSP 5 DIL28*
    PIC16LF873A-I/SO 4k 128 192 USART/MSSP 5 low pwr SO28
    PIC16F874-20I/P 4k 128 192 USART/MSSP 8 PSP DIL40
    PIC16F876-04/SP 8k 256 368 USART/MSSP 5 DIL28*
    PIC16F876-20/SP 4k 128 192 USART/MSSP 5 DIL28*
    PIC16F877-04/P 8k 256 368 USART/MSSP 8 PSP DIL40
    PIC16F877-20/P 8k 256 368 USART/MSSP 8 PSP DIL40
    PIC16F877A-I/P 8k 256 368 USART/MSSP 5 DIL40
    *Skinny DIP package


    or here:
     
  19. theshadow27

    theshadow27 What's a Dremel?

    Joined:
    23 Sep 2004
    Posts:
    616
    Likes Received:
    2
    you only need 1 PIC to program + read the eeprom, just diffrent subroutines :thumb:

    i suggested 2 PICs to make both of them easier to program, have less crowded code, and make it easeir to add features
     
  20. bigal

    bigal Fetch n Execute

    Joined:
    8 Oct 2004
    Posts:
    609
    Likes Received:
    0
    so like 1 to communicat with the PC and store the Caractersets and one to chunk that out column by column.. :sigh:

    is that really necciacary... it gets expensiver then.. all i want is a system where you can program it from a PC (pc can be left connected if necciary . .loads of spare 400mmx's etc) and a few basic effects (dissolve maby, scroll definantly and perhaps meet together (where the line scrolls in from left and right and meets in the middle) that is all. so is two pics and a eeprom necciary.. Is 2k ok for this, or do i need a 4k pic?
     

Share This Page