Free Project - 245 LED Display


Closed Thread
Page 1 of 6 12345 ... LastLast
Results 1 to 40 of 222
  1. #1
    T.Jackson's Avatar
    T.Jackson Guest

    Lightbulb Free Project - 245 LED Display

    I realize that with my time here thus far I have offered little in terms technical assistance, PIC Basic snippets and so on.

    So here's a nice BIG fish for everyone to cut their teeth on. A 245 LED, PC-programmable moving message display. Near-final cut, early last year the project was prototyped on two large PCBs and performed quite well. It's mandatory that high-intensity LEDs are used because the duty cycle is only around 2.8% for each column in the multiplex scheme. (Do NOT recommend expanding the display with more columns, the design is at its limits as is)

    The component count is quite immense. This includes a 16f628, 24LC256 EEPROM, Max RS232, Decade Counters - 4017 variety, tonne of common passives, it'll take a couple of solid days work to put together. I can't offer the PCB layout sorry.

    The zip file download includes schematics, micro controller source and Windows-based source written in Visual Basic 5.0, plus compiled executable. You will need the Virtual machine runtime DLL for the executable. This can be either msvbvm50.dll or msvbvm60.dll which are both freely obtainable.

    Best Regards,
    Trent Jackson
    Attached Files Attached Files
    Last edited by T.Jackson; - 29th March 2007 at 04:58. Reason: Correct upload

  2. #2
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Smile Nice Work!

    Hey Trent,

    Thanks for the nice upload. You have included a lot of detailed information. We can learn a lot from the project. Interesting.

    -Adam-
    Ohm it's not just a good idea... it's the LAW !

  3. #3
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Smile No problem

    I have also included a copy of the draft article - contains a modest amount of technical theory for the project. Sorry if some of you find it to be a bit of a hard read, it hasn't been proof read or edited, only been read by myself once or twice. In a technical sense I believe it to be accurate however.

    I do sincerely hope that someone finds the project of interest, quite a fair bit of my time was poured into its development. The software was written in a matter of just a couple of days, but the overall hardware design did take some considerable time. It was intended to be published as a full scale project in the Silicon Chip magazine. Unfortunately however it won't ever go to print. Too expensive to build, too quirky to assemble, for a project like this to be successful it needs a double sided through-hole plated PCB a long with LED modules - not 245 individual LEDs.

    All told, to make matters even more difficult, you can buy something like this pre assembled for under $100. It's just never gonna be this cheap for a KIT. But on the flip side of the coin, there is a nice learning aspect with building a big and useful project like this.

    Trent Jackson

  4. #4
    Join Date
    Apr 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Hi Trent Thank you very much for posting your project. Its verrrry interesting project and I want to build one for myself.

  5. #5
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    It's definitely worth building. Wish I still had my prototype. It was never returned to me.

  6. #6
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Smile

    Turns out I will be getting my prototype returned, so I can offer technical support to those keen on building it.

  7. #7
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    I build this circuit with only one 5X7 led display ( Col 1,2,3,4,5 ), But not working. Is it necessary to built all 7 display ?

  8. #8
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by precision View Post
    I build this circuit with only one 5X7 led display ( Col 1,2,3,4,5 ), But not working. Is it necessary to built all 7 display ?
    Can you be a bit more specific - what exactly have you done & what's not working?

    As is, without great modification, it would be next to useless with just 35 LEDs.

  9. #9
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    My controller circuit is same, But i connect only one 5x7 dot matrix display to IC3 ( cd4017)
    Attached Images Attached Images  

  10. #10
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by precision View Post
    My controller circuit is same, But i connect only one 5x7 dot matrix display to IC3 ( cd4017)
    I see. Are you able to successfully upload a message from the Windows software to the EEPROM? If so, do any of the LEDs come on?

    (You need to describe exact symptoms - theoretically, because each character is actually 5x7, I guess the circuit should show a quick flicker of single characters on 35 LEDs. There would be noticeable pauses in between. In other words, yes I believe it should do something with just 35 LEDs.
    Last edited by T.Jackson; - 19th April 2007 at 05:28.

  11. #11
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    How i confirm that i successfully upload a message from the Windows software to the EEPROM?

    I also using 24c04 instead of 24c256,

    will you upload eny video of working display ?

    Are display something look like This video ?


  12. #12
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by precision View Post
    How i confirm that i successfully upload a message from the Windows software to the EEPROM?

    I also using 24c04 instead of 24c256,

    will you upload eny video of working display ?

    Are display something look like This video ?

    Do you realize that the 24c04 is technically different to the 24c256? You can't just whack in the 24c04 and hope for the best - it won't work without modifying the software. The 24c04 is cumbersome to work with compared to the 24c256. Byte sized addressing and bank switching complicate a relatively simple need.
    Last edited by T.Jackson; - 19th April 2007 at 10:12.

  13. #13
    Join Date
    Apr 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Smile

    Greetings Trent,
    I am now starting to build your project, I'm on stage one building 4017 sequencer. I have some question, is it possible to extend it for more characters, as of now it has seven character i want to extend it for more characters. can you please guide or give some example on how to do it. Thanks in advance....

  14. #14
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Dazheng View Post
    Greetings Trent,
    I have some question, is it possible to extend it for more characters, as of now it has seven character i want to extend it for more characters. can you please guide or give some example on how to do it. Thanks in advance....
    I don't recommend cascading anymore sections. The duty cycle is extremely low as it is. About 2.5% for each column. What this all means is that the LEDs won't be bright enough if more columns are added.

    If you want to build a really huge display with a 100 or so columns, your best bet would be to use a few PIC16f877's. Break it into 4 sections - 25 columns for ea controller. The display will be nice & bright this way. Big job!

    The hardest part will be in the software, making sure that ea section is properly synchronized with minimal latency. Shuffling data between ea section. On second thought - it's a masive job to do properly.

  15. #15
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post Pictures of prototype

    I just scanned in a few pics of the original prototype - thought I'd upload them.

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1563&d=1177470983" align="left">
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1564&d=1177471027">

    Not bad for a single sided PCB huh?
    Attached Images Attached Images   
    Last edited by T.Jackson; - 25th April 2007 at 09:29.

  16. #16
    Join Date
    Apr 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Smile

    WOW... Cool and awesome design. Trent is it possible for you to feature here your PCB layout? I know how hard you work for it, just a humble and simple request... Thanks in advance.

  17. #17
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Dazheng View Post
    WOW... Cool and awesome design. Trent is it possible for you to feature here your PCB layout? I know how hard you work for it, just a humble and simple request... Thanks in advance.
    Unfortunately I can't offer the PCBs. Main reason, the Protel libraries that I used
    aren't mine. They are owned by Silicon Chip publications.

  18. #18
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post How do they do it?

    <pre>
    Here you can buy one pre-made that's bigger, better and brighter for less money. Like I said before - DIY is history...
    </Pre>
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1572&stc=1&d=117757599 2">
    <pre>
    Few years back something like this would have cost many hundreds of dollars
    </pre>
    Attached Images Attached Images  
    Last edited by T.Jackson; - 26th April 2007 at 10:38.

  19. #19
    ismael b.'s Avatar
    ismael b. Guest


    Did you find this post helpful? Yes | No

    Smile Scanner Pcb

    HELLO TRENT

    The OTHER SIDE Of the PCB is POSSIBLE SCANNEAR WHERE THEY ARE the COMPONENTS (CD4017, pic16f628, etc). OPPOSING SIDE OF THE COMPONENTS.

    DEBTOR,


    ISMAEL BRATTI BRAZIL

  20. #20
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Picture far right shows the main controller board with all associated digital circuitry. Suggest taking a closer look.

    Far left - the display board which houses all 245 LEDs a long with column drivers
    (Q1 - Q35). The display board is stacked on top of the controller board and wired accordingly. (see schematic) <br/>

  21. #21
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post Missing Dependency File

    Someone has just brought to my attention that there's a missing dependency file in the download. This file is mscomm32.ocx and is required for serial communications. Unfortunately I can't include this in the download because I"m not licensed to do so.

    You may obtain it here:
    http://www.2ocx.com/show.php?ocx=mscomm32.ocx

    <br/>

  22. #22
    Join Date
    Apr 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Talking

    Did you make a movie or something of the display working so we can see how it looks when ready? Mine is almost done!

  23. #23
    Join Date
    May 2006
    Location
    Kedah, Malaysia
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by T.Jackson View Post
    I realize that with my time here thus far I have offered little in terms technical assistance, PIC Basic snippets and so on.

    So here's a nice BIG fish for everyone to cut their teeth on. A 245 LED, PC-programmable moving message display. Near-final cut, early last year the project was prototyped on two large PCBs and performed quite well. It's mandatory that high-intensity LEDs are used because the duty cycle is only around 2.8% for each column in the multiplex scheme. (Do NOT recommend expanding the display with more columns, the design is at its limits as is)

    The component count is quite immense. This includes a 16f628, 24LC256 EEPROM, Max RS232, Decade Counters - 4017 variety, tonne of common passives, it'll take a couple of solid days work to put together. I can't offer the PCB layout sorry.

    The zip file download includes schematics, micro controller source and Windows-based source written in Visual Basic 5.0, plus compiled executable. You will need the Virtual machine runtime DLL for the executable. This can be either msvbvm50.dll or msvbvm60.dll which are both freely obtainable.

    Best Regards,
    Trent Jackson
    Trent Jackson,
    I am really interested with your project but can you please post the code here?
    I want to see the code and try to understand it.
    That is the best way for me to understanding your design.

    If cannot then fine.


    Thanks in advance.

    Ops sorry I just found the code here.

    Sorry for not looking the file properly.
    I will try this and ask you if I have any question.

    Thanks

  24. #24
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post It's all in the download

    Everything is in the d/l - if you have any queries then just post them here.
    Last edited by T.Jackson; - 9th May 2007 at 07:17.

  25. #25
    Join Date
    Apr 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Question still not running right :(

    Dear Trent, i have recently installed Win XP on my comp and copyed MSCOMM32.OCX in sys32 (VB not installed) ; the aplication runs but when i press "program messege to eeprom" button, i get an Communications error "Port already in use or doesn't exist ; Chose a different port " but the com1 is free; what do i do?

  26. #26
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    Apart from suggesting that you try another comm port, it's hard-to-say because everything works fine on my end. I have Win XP with service pack 2. If there was a problem MSCOMM32.OCX, the program wouldn't run at all. So you can rule that out.

  27. #27
    Join Date
    May 2007
    Posts
    43


    Did you find this post helpful? Yes | No

    Post Dear Jackson

    I have build my led matrix from the start to finish. and i have some problems... I finaly programmmeed the PIC and when i connect the 5V and the 12V and the Serial Port, and when i bush the button for program LED it doesen`t stay ON (lighting).I start the VB program to sent EEPROM the informations but when finished nothing happens. I have a link with the sheme that i construct... i hope you can help me... THX.. I will wait for your answer.

    http://www.zamfirelu.org/lm.jpg
    Last edited by magu; - 30th May 2007 at 01:02.

  28. #28
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    What is this ?
    Why you mount all 14 capacitor in one place ? and there are no capacitor between PIC's VCC and GND.


    .
    Attached Images Attached Images  

  29. #29
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post Learn electronics first

    I'm getting emails left right & center from people telling me about their problems with this thing. It's not a simple project - in my opinion, it requires the constructor to have some sort of formal background with electronics. If you build it, you've gotta be prepared to fault find your mistakes, because you will make them, there's a lot of wires & parts and a whole range of silly little errors that could occur.

    By the way, I noticed on your photograph of the board that all the 0.1uf decoupling caps are banked up together ??? They actually need to be placed as close as possible to the power connections of each chip. (That's why there's so many of them, one for each chip) Knowing this sort of thing is relatively basic electronics and if you aren't aware of simple things like this then I highly discourage you from building it. Sorry - the truth hurts.

  30. #30
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by T.Jackson View Post
    Knowing this sort of thing is relatively basic electronics and if you aren't aware of simple things like this then I highly discourage you from building it. Sorry - the truth hurts.
    Abso-tively Poso-lutely....the sequence should be: One blinky LED, then 245...

    But, we all know, it usually starts the other way around...

    245 non-blinky LEDs, then back to one non-blinky LED, then on to one blinky LED, then, and only then, do you get 245 blinky LEDs...(well, maybe a few extra steps in between)...

  31. #31
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    When I've got some spare time I might write an article describing "basic" electronics and trouble shooting. So anyone that's having difficulty with the project, just put it aside until you've had a chance to read the article. It'll be a while though, I'm actually a full time student at the moment struggling to do a 4yr degree in information technology.

  32. #32
    Join Date
    May 2007
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Tell me pls a the possible problem...

    Tell me pls a the possible problem that the board doesen`t work. I connect the entire wires to the pics and capacitor, diodes and rezistors; i change the pic over 3 times, the eeprom 2 times but doesen`t work... i sincerily i need some help.
    Attached Images Attached Images   

  33. #33
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by magu View Post
    Tell me pls a the possible problem that the board doesen`t work. I connect the entire wires to the pics and capacitor, diodes and rezistors; i change the pic over 3 times, the eeprom 2 times but doesen`t work... i sincerily i need some help.
    We all 'sincerily' need help...but...100,000+ different things can cause this to fail...
    Wiring faults (go over 100 times and you still miss that ONE wire that's wrong, programmer faults, etc.etc...
    But for one...I see the cap's in the cluster still haven't moved nearer to the chips like suggested earlier!!!

  34. #34
    Join Date
    May 2007
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    tell me pls what capacitor do i ha\ve to place and where?

  35. #35
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by magu View Post
    tell me pls what capacitor do i ha\ve to place and where?
    The caps are the least of your worry. What about the LEDs? You've used common diffused 5mcd types, these won't be bright enough. I clearly made mention of this several times in the article and on the schematic. Unfortunately, I feel, you've bitten off more than you can chew.

  36. #36
    Join Date
    May 2007
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    Those are the steps that i should follow?

    1. Install Visualbasic
    2. Connect the board to 5v and 12v
    3. Connect the serial port to board
    4. Start VB program (programing the eeprom)
    5. Push the program button (the led should stay litghing?)
    6. Program the eeprom from VB program
    Those steps are good?

  37. #37
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    Yes - sounds about right.
    Last edited by T.Jackson; - 31st May 2007 at 15:20.

  38. #38
    Join Date
    May 2007
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    but the problem is that the led doesn`t stay on (lighting). you know what the cause is?

  39. #39
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    The purpose of that LED is to give a visual indication that the PIC is indeed receiving data from the PC. It should toggle on/off with every byte received.
    Initially, when the program button is pressed - the LED should be lit, assuming that the TX line from the PC to the PIC is idle (or not connected at all).

    After the PIC receives its first byte - the LED should change states. Upon receiving the second, once again changing states. It should continue to do so until the PC has finished programming it. The LED is of little importance and the message that you program should begin to scroll automatically after successful download.
    Last edited by T.Jackson; - 1st June 2007 at 03:01.

  40. #40
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Smile A new lease on life for my prototype ...

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1693&stc=1&d=118075962 7">
    <hr/>
    The fact of the matter is, after all of this - I honestly have no use for a scrolling marque display. Primarily, the project was only ever attempted in efforts to add to my collection of published projects in the Silicon Chip magazine. As I've stated before, it won't ever being seeing the light of day inside any magazine. So the question for myself was, what do I do with this bloody thing? I put so much time into it, shame to just give it the "heave-ho" in the trash can. After several moments of considerable thought it dawned on me to yes, you guessed it - turn it into a clock! Why not?, its plenty big enough, at least for a 12hr one that is. Unfortunately, however though, its a couple of columns shy for a 24hr clock, at least for me it is, since I concluded that (5x7) digits are mandatory. Much in between just doesn't quite look right. So here it is, source code and all for those of you who have built this thing and would like to turn it into a clock. I also wrote a simple VB app that is used to set the time. (See screen shot) The VB source and everything else is in the download.
    Code:
       Include "modedefs.bas"    ' Include serial modes
       Define OSC 4              ' 4MHz crystal   
       CMCON      = 7            ' All digital
       OPTION_REG = %10000111    ' TMRO prescale = 256
       TRISA      = %00010000    ' All outputs except RA4
       TRISB      = %00000000    ' All outputs ...
       INTCON.5   = 1            ' Enable TMR0 interrupts   
       INTCON.2   = 0            ' Reset overflow flag
       
       on interrupt goto Clock 
                     
       '// Chrs (0-9) stored in on-chip E²PROM
       data @0,62,65,65,65,62   ' 0
       data @5,64,127,66,0,0    ' 1
       data @10,70,73,81,97,66  ' 2
       data @15,54,73,73,65,34  ' 3
       data @20,16,127,18,20,24 ' 4
       data @25,49,73,73,73,39  ' 5
       data @30,50,73,73,73,62  ' 6
       data @35,3,5,9,113,1     ' 7
       data @40,54,73,73,73,54  ' 8
       data @45,62,73,73,73,38  ' 9
       data @50,0,0,0,0,0       ' Space
       data @55,8,8,8,8,8       ' Colm
    
       Row_Data     VAR BYTE    ' Contains one column worth of a chr at a time 
       Column_Scan  VAR BYTE    ' Current col that's active
       Digit_Pos    Var byte    ' E²PROM address pointing to current col data 
       Digit_Loc    VAR Byte    ' Start E²PROM address for new chr
       Colm         var byte    ' Blinking colm ...
       Counter      VAR Word    ' Time keeping counter               
       Secs_Digit1  var byte    ' Secs (1's)
       Secs_Digit2  var byte    ' Secs (10's)
       Mins_Digit1  var byte    ' Mins (1's)
       Mins_Digit2  var byte    ' Mins (10's)
       Hrs_Digit1   var byte    ' Hrs (1's)
       Hrs_Digit2   var byte    ' Hrs (10's)
     
       Clock_Cols   VAR PORTB.6
       Reset_Cols   VAR PORTB.5
       ROW1         VAR PORTA.2
       ROW2         VAR PORTA.3
       ROW3         VAR PORTB.4
       ROW4         VAR PORTB.3
       ROW5         VAR PORTB.0
       ROW6         VAR PORTB.2
       ROW7         VAR PORTB.1
       Prog_Button  VAR PORTA.4
       TX_To_PC     var PORTB.7
           
       Counter     = $7A12               
       TMR0        = 0                    
       Column_Scan = 0
       Digit_Pos   = 0
       Secs_Digit1 = 0
       Secs_Digit2 = 0
       Mins_Digit1 = 0
       Mins_Digit2 = 0
       Hrs_Digit1  = 2
       Hrs_Digit2  = 1
       Colm        = 0
       Reset_Cols  = 1
       Reset_Cols  = 0
       
    LED_Display:                                         ' Scan cols & output row dat
       @ incf _Column_Scan, 1                            ' Inc col
       @ incf _Digit_Pos, 1                              ' Inc chr pos (0-4)
       Row_Data = 0                                      ' Reset 
       IF Column_Scan = 37 THEN Column_Scan = 1          ' ^     
        
       select case Column_Scan
          case 1                                         ' Secs (1's) 
             Digit_Pos = 0                               ' Reset  
             Digit_Loc = (Secs_Digit1 * 5)               ' Set loc
          case 6                                         ' Space
             Digit_Pos = 0
             Digit_Loc = 50
          case 7                                         ' Secs (10's)
             Digit_Pos = 0
             Digit_Loc = (Secs_Digit2 * 5)
          case 12,13                                     ' Colm
             Digit_Pos = 0
             IF Colm = 2 then                            ' Blink colm
                Digit_Loc = 55 
             else
                Digit_Loc = 50
             endif
          case 14                                        ' Mins (1's)
             Digit_Pos = 0
             Digit_Loc = (Mins_Digit1 * 5)
          case 19
             Digit_Pos = 0                               ' Space
             Digit_Loc = 50
          case 20                                        ' Mins (10's)
             Digit_Pos = 0
             Digit_Loc = (Mins_Digit2 * 5)
          case 25,26                                     ' Colm
             Digit_Pos = 0
             IF Colm = 2 then
                Digit_Loc = 55 
             else
                Digit_Loc = 50
             endif
          case 27                                        ' Hours (1's)
             Digit_Pos = 0
             Digit_Loc = (Hrs_Digit1 * 5)
          case 32                                        ' Space
             Digit_Pos = 0
             Digit_Loc = 50
          case 33                                        ' Hours (10's)
             Digit_Pos = 0
             if Hrs_digit2 = 0 then                      ' Show either 1 or nothing 
                Digit_Loc = 50                           ' (12hr time only)
             else
                Digit_Loc = 5
             endif  
       end select
    
       read Digit_loc + Digit_Pos, Row_Data              ' Fetch portion of digit
                                                         ' One column at a time                
       '// Switch off all rows before advancing the counters
       ROW1 = 0
       ROW2 = 0
       ROW3 = 0
       ROW4 = 0
       ROW5 = 0
       ROW6 = 0
       ROW7 = 0
    
       '// Prog button pressed?
       if Prog_Button = 0 then GOTO Set_Time             
    
       '// Clock cascaded counters
       Clock_Cols = 1 
       Clock_Cols = 0 
    
       '// Logically AND data with row bit values and write to port asynchronously 
       IF Row_Data & 1  THEN ROW1 = 1
       IF Row_Data & 2  THEN ROW2 = 1 
       IF Row_Data & 4  THEN ROW3 = 1
       IF Row_Data & 8  THEN ROW4 = 1       
       IF Row_Data & 16 THEN ROW5 = 1
       IF Row_Data & 32 THEN ROW6 = 1 
       IF Row_Data & 64 THEN ROW7 = 1  
       GOTO LED_Display                                  ' Loop back
    
       disable                                           ' Disable interrupts here
    Clock:                                               ' Time keeping routine   
       INTCON.2 = 0                                      ' Clear TMR0 overflow flag
       Counter = Counter - $1000                         ' Dec      
       IF Counter < $1000 THEN                           ' 0.5 sec elapsed? 
          if colm = 2 then                               ' 1 sec elapsed
             @ incf _Secs_Digit1, 1                      ' Inc secs first digit
             If Secs_digit1 = 10 Then                    ' Secs first digit = 10? 
                @ incf _Secs_Digit2, 1                   ' Inc 10's of secs 
                Secs_digit1 = 0                          ' Reset first digit
                If Secs_digit1 = 0 then                  ' Has one minute elapsed?
                   if Secs_digit2 = 6 Then              
                      @ incf _Mins_Digit1, 1             ' Inc mins first digit
                      Secs_digit2 = 0                    ' Reset secs second digit
                      if Mins_digit1 = 10 then           ' 10 mins elapsed?
                         @ incf _Mins_Digit2, 1          ' Inc 10's of mins
                         Mins_digit1 = 0                 ' Reset first mins digit
                         If mins_digit1 = 0 then         ' 60 mins elapsed?
                            if mins_digit2 = 6 Then      '
                               @ incf _Hrs_Digit1, 1     ' Inc hours first digit
                               mins_digit2 = 0           ' Reset mins second digit
                               if Hrs_digit1 = 10 then   ' 10 hours elapsed?
                                  Hrs_digit1 = 0         ' Set hours digits to show 10
                                  Hrs_Digit2 = 1        
                               EndIf                   
                               if Hrs_digit1 = 3 then    ' 12 hours elapsed?
                                  if hrs_digit2 = 1 then '
                                     Hrs_digit1 = 1      ' Reset hours to 1
                                     Hrs_digit2 = 0      '
                                  endif
                               endif
                            endif
                         endif
                      endif        
                   endif
                endif
             endif      
             Colm = 0                                    ' Colm off ...
          endif                                          '
          Counter = Counter + $7A12                      ' Reset counter with 0.5s            
          @ incf _Colm, 1                                ' Toggle colm every 0.5s
       endif      
       resume
    
    Set_Time:
       low Prog_Button                                   ' Set LED    
       SERIN TX_To_PC, N2400, ["@"], Hrs_Digit2, Hrs_Digit1, Mins_Digit2, Mins_Digit1, Secs_Digit2, Secs_Digit1
       input Prog_Button                                 ' Resume as input for prog but  
       Reset_Cols  = 1                                   ' Reset 4017 counters
       Reset_Cols  = 0                                   '
       Column_Scan = 0                                   ' Reset to start of scan
       goto LED_Display                                  ' Start clock
    Trent Jackson
    <hr/>
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1694&stc=1&d=118076150 6" align="right">
    Attached Images Attached Images   
    Attached Files Attached Files

Closed Thread
Page 1 of 6 12345 ... LastLast

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 07:14
  2. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 09:42
  3. Replies: 2
    Last Post: - 14th July 2008, 23:11
  4. 245 Led Matrix Display (as constructed by Magu)
    By magu in forum Code Examples
    Replies: 11
    Last Post: - 29th June 2007, 01:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts