CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

LED Matrix Table, Debug help!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mekohler



Joined: 07 Dec 2007
Posts: 1

View user's profile Send private message

LED Matrix Table, Debug help!
PostPosted: Fri Dec 07, 2007 1:40 am     Reply with quote

Been working on an LED matrix table for a few months, with the help of some guy I found online. Here is the circuit schem:

http://www.injektilo.com/Circuit%20Progress/Final%20Circuit.jpg

The matrix itself is composed of a 25 cubicles (5 x 5)...each cubicle has 6 LED's in parallel (although the schem shows 8)

http://www.injektilo.com/Circuit%20Progress/8%20Led%20Matrix%20Exampl.jpg

Everything works, but the LED's are not as bright as when I initially tested each cubicle with a 9V battery. You can barely tell when a cubicle is lit through the table's diffusive glass!

Here is the PIC code...in this example I first have the lower leftmost cubicle light up, then all of them...this can be changed to as many patterns and stuff as I want, obviously:

Code:


#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,

0b11111,
0b11111,
0b11111,
0b11111,
0b11111};

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 first char

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

CurLetter = (CurLetter +1) % 2; //Increment Letter






Now I used resistors in the 6 parallel LED's assuming they would get 12V, here are some measurements I made having row 1 and column 1 lit all the time:

Voltage:

1) From PSU Ground to 1 cubicle COLUMN input: 5.25 V

2) From PSU Ground to 1 cubicle ROW input: 3.85 V

3) From ROW input to COLUMN input of a cubicle: .86V (I dont think this means anything, since this is an incorrect way to measure V)

Current:

4) Removing one LED cubicle in the all lit column and connecting column output of LED below and column input of LED above to the meter: 2.53 using 20mA setting/resolution

5) Removing one LED cluster in the all lit row and connecting row ouput of LED to the left and row input of LED to the right to the meter: 12.17 using 20mA setting/resolution

6) Removing the top left LED cubicle and connecting row output from my UNL chip and column output from LED cluster below it: 116 using 200 mA resolution


The guy I am working with says he think the problem lies in the coding...that I am using pulses instead of just on or off states. I'm not sure how to find the duty cycle or account for it. I just want to find a way to make them brighter, as they are 12000mcd LED's.

I know this is alot of information, but I am all finished, It's just too damn dim!

A video of it not in my table with partitions...it looks brighter in the camera but it's not bright enough to really shine through diffusive glass irl.

http://www.youtube.com/watch?v=kuMaE_b4Wg4
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Dec 07, 2007 2:07 am     Reply with quote

This code is for the Hi-Tech compiler. You should post your question on
the Hi-Tech forum:
http://www.htsoft.com/support/forums.php
SET



Joined: 15 Nov 2005
Posts: 161
Location: Glasgow, UK

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Dec 07, 2007 10:14 am     Reply with quote

Code:
CurLetter = 0;  // Start With first char

while (1 == 1)  // Loop Forever
{
 for (Dlay = 0; Dlay < 25; Dlay++)
  // I doubt this next line compiles..
  for (i = 0; i <5>> 2) & 0b010000;
   PORTC = j & 0b111111;  // why AND with 1's?
   PORTA = k + i;  // what changes 'k'?
   for  (n = 0; n < 259; n++); // 4ms Delay
 }
// end of while, so CurLetter never changes..
CurLetter = (CurLetter +1) % 2; //Increment Letter
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group