Table LED Matrix, Weeks of debugging, column problems


Closed Thread
Results 1 to 28 of 28

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    You cannot measure the pulses with just an voltmeter. You need for sure an oscilloscope.

    The measurement is an "average" of the pulses. So that value sounds OK on a voltmeter.

    Ioannis

  2. #2
    Join Date
    Feb 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Ioannis,

    I was working with Marcos on this and I am a little confused with the code and it using the decoder 74LS or HC138! We have the circuit working but the thing I noticed is that the PIC does not just give the 74LS138 just single HIGH and LOWS on the address lines. I used a logic probe since I don't have a scope at home and I am getting pulses. I also get pulses out on the outputs of the 74LS138. I can confirm this because I can see it when the leds light they have a pulse to them. In my experience working with electronics and looking at the data table for the 138 that it does not require a data stream but just highs and lows. The signal(pulses) I am getting is very fast. In my theory it should not require that fast of pulses for what we are doing. I should also be able to see the highs and lows at least from the 138 outputs that controls the column output lines.

    I have attached a pic of the circuit and the code. If you could explain the code I would appreciate it. I am more of a VB6 programmer not a microprocessor programmer though I am learning.

    If the code can be changed to not have those pulses going on it would make for a better circuit.

    #include <pic.h>


    __CONFIG(INTIO & WDTDIS & PWRTEN & MCLRDIS &
    UNPROTECT \
    & UNPROTECT & BORDIS & IESODIS & FCMDIS);

    int i, j, k, n, Dlay, CurLetter;

    const char Letters[] = {

    0b10000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,

    0b01000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,

    0b00100,
    0b00000,
    0b00000,
    0b00000,
    0b00000,

    0b00010,
    0b00000,
    0b00000,
    0b00000,
    0b00000,

    0b00001,
    0b00000,
    0b00000,
    0b00000,
    0b00000,

    0b00000,
    0b00001,
    0b00000,
    0b00000,
    0b00000,

    0b00000,
    0b00010,
    0b00000,
    0b00000,
    0b00000,

    0b00000,
    0b00100,
    0b00000,
    0b00000,
    0b00000,

    0b00000,
    0b01000,
    0b00000,
    0b00000,
    0b00000,

    0b00000,
    0b10000,
    0b00000,
    0b00000,
    0b00000,

    0b00000,
    0b00000,
    0b10000,
    0b00000,
    0b00000,

    0b00000,
    0b00000,
    0b01000,
    0b00000,
    0b00000,

    0b00000,
    0b00000,
    0b00100,
    0b00000,
    0b00000,

    0b00000,
    0b00000,
    0b00010,
    0b00000,
    0b00000,

    0b00000,
    0b00000,
    0b00001,
    0b00000,
    0b00000,

    0b00000,
    0b00000,
    0b00000,
    0b00001,
    0b00000,

    0b00000,
    0b00000,
    0b00000,
    0b00010,
    0b00000,

    0b00000,
    0b00000,
    0b00000,
    0b00100,
    0b00000,

    0b00000,
    0b00000,
    0b00000,
    0b01000,
    0b00000,

    0b00000,
    0b00000,
    0b00000,
    0b10000,
    0b00000,

    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b10000,

    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b01000,

    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00100,

    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00010,

    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00001};

    main()
    {
    PORTA = 0; // All Bits are Low
    PORTC = 0b000001; // Start With Top Left
    CMCON0 = 7; // Turn Off Comparitors
    ANSEL = 0; // Turn Off ADC
    TRISA = 0b101000; // RA5/RA3 Inputs
    TRISC = 0;

    CurLetter = 0; // Start With "A"

    while (1 == 1) // Loop Forever
    {
    for (Dlay = 0; Dlay < 25; Dlay++)
    for (i = 0; i < 5; i++)
    {
    j = Letters[(CurLetter * 5) + i];
    k = (j >> 2) & 0b010000;
    PORTC = j & 0b111111;
    PORTA = k + i;
    for (n = 0; n < 259; n++); // 4ms Delay
    }

    CurLetter = (CurLetter +1) % 25; //Increment Letter
    }


    Thanks,
    Kevin
    Attached Images Attached Images  
    Last edited by jukeman; - 28th November 2007 at 02:05.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Besides the factor that I don't understand the data block at the beginning of the snippet and also that I don't program in C, your code seems that is doing what is supposed to do.

    There are 2 loops one inside the other, scanning the matrix with 4ms from col to col so a total of 20ms is achieved to scan the whole matrix. I cannot understand what is bothering you exactly. The pulses you mention have to be there! Otherwise cannot the display cannot be scaned. Am I missing something?

    Ioannis

  4. #4
    Join Date
    Sep 2007
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Finally got the damn thing working. I still don't understand the oscilloscope bit but oh well.


  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    And the problem was?

    Ioannis

  6. #6
    Join Date
    Feb 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    The problem was what he was wanting to do with a simple circuit in the beginning!

    Watch the video link and you will see the leds flashing instead of staying on steady, it's just like they are running from a pulse width modualtion setup with a low frequency and you can see them flash.

    I guess from the way you talk to me that I don't know what I'm talking about, it works don't it. I just don't like the flashing. They should either be on or off and not flashing! Why does it need to scan the matrix were not running video across it, come on i'm not a newbe here!
    Last edited by jukeman; - 28th November 2007 at 23:55.

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Hey Kevin, cool down. I am trying to help here.

    You may know little, much or everything, I don't argue about that.

    I am pointing out some cases that I susspect or have opposed during my experiments and would like someone have pointed me when I was awake all night to spot them...

    Anyway, seeing a matrix, one guesses that scanning is needed. I did not quite understood from the beggining that finally only one element should stay on at a time.

    The programm in C was writen to scan the matrix. For a completely different application than yours.

    For your case, yes, if you want to just light one element at the time, only the col and row that corresponds to must be ON. There is no need for scanning resulting the flickering you see.

    So the programm should only set the corresponding bits at proper level (0 or 1) and wait for a few seconds. At C I don't know how though.

    Ioannis
    Last edited by Ioannis; - 29th November 2007 at 08:57.

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  3. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 04:59
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. 18F452 "Unknown Processor" errors
    By schwinn_rider in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th April 2006, 03:56

Members who have read this thread : 0

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