need help with problem
stilgar
Posts: 47
After 12-20 attempts to get this working that all ended in chaos or shutdown, I need help.
This program worked with the intended hardware. But now I need to get it to work with a older piece of hardware.
A little background...
The program was written for hardware that has 16 leds, individuality controlled. (led pins P27-P12)
The old hardware uses a led matrix of 8 leds in 2 matrix . (led pins P27-P20, control pins P18-P19), (the control pins connect each matrix to ground through a npn transistor and 120 ohm resistor.)
What I need to do is change the output to control the matrix.
matrix normal operation..
High on P18, cycle High through P27-P20.
High on P19, cycle High through P27-P20
reverse the cycle..
High on P19, reverse cycle High through P27-P20.
High on P18, reverse cycle High through P27-P20.
I have added notes as to what parts need to do and a copy of the V2 version program, If you would add notes, so I can see what your changes do.
Thankyou,
stilgar
V2 upgrade - Archive [Date 2012.12.04 Time 14.50].zip
This program worked with the intended hardware. But now I need to get it to work with a older piece of hardware.
A little background...
The program was written for hardware that has 16 leds, individuality controlled. (led pins P27-P12)
The old hardware uses a led matrix of 8 leds in 2 matrix . (led pins P27-P20, control pins P18-P19), (the control pins connect each matrix to ground through a npn transistor and 120 ohm resistor.)
What I need to do is change the output to control the matrix.
matrix normal operation..
High on P18, cycle High through P27-P20.
High on P19, cycle High through P27-P20
reverse the cycle..
High on P19, reverse cycle High through P27-P20.
High on P18, reverse cycle High through P27-P20.
I have added notes as to what parts need to do and a copy of the V2 version program, If you would add notes, so I can see what your changes do.
Thankyou,
stilgar
V2 upgrade - Archive [Date 2012.12.04 Time 14.50].zip
Comments
thanks
stilgar
I'll give this a shot and try to post something tomorrow.
Which of the cathode control pins (18&19) control the LEDs that had been controlled by pins 12 - 19?
So all I need is the multiplexed pwm driver, JonnyMac. If you are still up to it.
Duane Degn, I have attached a schematic of the LED matrix.
Thanks
stilgar
Sweep speed controlled by pot on P4.
After chip start up...
1. Center LED (P23) fads from off to full brightness.
2. LEDs sweep to left edge (P20).
3. LEDs sweep full across to right (P20-P27) (Keep in mind the LED matrix).
4. LEDs sweep full across to left (P27-P20) (Keep in mind the LED matrix).
5. Repeat 3. and 4. forever.
thanks
stilgar
I didn't really try to understand what the code was doing, I just looked for the section that set pins high and only set half the pins high at a time.
The code isn't user friendly. The pin masks are hardcoded.
I modified three sections of the LED object. Here's the first modification.
The above just sets the masks as outputs. I commented out the original direction setting code.
The meat of the change is in this next section. Again, I commented out the original code (two lines this time).
The above code breaks up the "accum" mask into two sections and turns on eight bits at a times.
The final section includes the hardcoded variables.
If the wrong set of eight LEDs light up switch the values for lowLedsCathodeMask and highLedsCathodeMask.
It's always risky posting untested code. I hope it works.
Are you sure the trailing effect is done in hardware? The PASM driver looks like it takes care of that.
Let me know if this works.
here is a schematic of the hardware
After careful consideration, I have come to the realization that it would be a waste of time to mod the V3 programing, so I am working on a new program for this hardware.
Thanks to all that have helped in this.
thanks,
stilgar
I assume VDD is really Vss in the schematic?
V2 has the line:
if you change it to:
The software wont add persistence.
Though without adding software persistence, the program is trivial.
Did you try my modification?
I tried your mod, it appeared ALL LEDs came on at the same time, but went out after about 2 sec. The battery was dead. I will try again when I get neww battery.
All the other code works correctly. I have it sweeping a led back and forth.
What I am trying to do is, when a button is pushed it causes the leds to slow down and stop. the led that it stops on then fades.
I keep getting the same thing, when the button is pushed and held it ALWAYS stops on led 1(P20) and don't fade.
what did I do wrong, or miss ?
thanks
stilgar
wakeup - Archive [Date 2012.12.07 Time 19.01].zip
and should be placed in the " VAR " section
thanks,
stilgar