NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » LED Array, Single column will not light

January 22, 2010
by Farmer
Farmer's Avatar

I have a single column on my panel that refuses to light. Original test pattern proved successful, and I also loaded the template.c file and got the scrolling question mark to work. Week later I download new program and nothing worked. (Guessing my programming) Re-loaded original test pattern to verify panel is working correctly and find single row in column #6 is out. My assumption is that the original "nothing worked" problem is not related.

I have also eliminated wiring as the cause. By pulling Column #6 wire (PD2) from the board and connecting a battery I find that both fwd and rev LED's do work. Probing across all rows I can make all the missing column lights work.

I do not believe that the code is the issue. It is the unaltered test pattern from the download. (EXCEPTION: /dev/ttyUSB0 to COM4) I also deleted the created "make" files before running a new compile.

I want to narrow the problem down to a bad micro controller. If it is the micro controller, then I believe pin PD2 is not "throwing low".

This is where the real learning begins.... LOL

Wide Open to suggestions.

alt image text

FWD alt image text

REV alt image text

Related: LED Build

January 23, 2010
by Rick_S
Rick_S's Avatar

You could try swapping that column wire to with another one to see if the problem shifts with it. That would eliminate any possibility of an issue with the board.

Secondly, you can modify the led_blink program to output at the port you are having problems with. That program will toggle the port high and low. You could put 2 led's with resistors on that port one with the anode on your port thru a resistor to ground, and the other with a cathode to the port with a resistor to 5v. If the LED's toggle, then the port is working in that situation and then the real fun will begin... If it isn't working then something may have happened to that port on your chip.

Rick

January 23, 2010
by Farmer
Farmer's Avatar

You are correct, flipping column 6 (PD2) and column 7 (PD3) wires "shifts" the bad column over one. Do you have a link for the blinking LED code? I looked around a bit but only found the Traffic light controller. I am guessing the blinking LED will not work either based on current operating circumstances. I did pick up the extra 328P chip in my original purchase. I think I will swap them out and modify the code for the larger chip.

Do these things "just go bad", or is it something I did possibly?

Where is a good place to pick up just a 168P chip? I read a lot of posts where enthusiasts seem to get a number of FREE components.

Thanks for the input/comments.

January 23, 2010
by jastermerrel
jastermerrel's Avatar

Download the NerdKit guide again under the members section. It seems to be an update to the one that I got with my kit. Page 65 has the led blink code.

Hope you get it figured out!

January 23, 2010
by Rick_S
Rick_S's Avatar

The led_blink program should be part of your code folder download. It is also referenced in the current NK guide page 66.

Depending on when you purchased your kit, you may or may not have that in your folder. It was added somewhat recently. If you don't, just re-download and you'll have it. All you should need to do in the led_blink program is change the port they are toggling to the port you are having problems with. use the two led's as described and you can see if it works or not.. As to a good place to buy chips, I tend to get them from e-bay. However, keep in mind only chips purchased from the NK guys will have their bootloader installed. Any chip purchased elsewhere will not behave like the NK chips without having the NK bootloader installed. If that is an issue, you may just want to buy spares from the NK guys... Their prices aren't too far off others and they have already installed the bootloader and tested it for you.

Rick

January 23, 2010
by Rick_S
Rick_S's Avatar

Sorry, I just realized jastermerrel posted a similar response. I left the house after previewing my post but without posting it.... So when I got back, I realized I hadn't posted and hit the button. Apparently in the in-between time, jastermerrel posted...

Rick

January 23, 2010
by Farmer
Farmer's Avatar

Thanks for the replies.... I swapped out the chips and modified the code for the new chip, but..... No Array

I made the following modifications to the "make" and "ledarray.c" files in ledarray_test folder:

mmcu=atmega168 to mmcu=atmega328p and -p m168 to -p m328p also the COM4 setting.

Added: #include "../libnerdkits/io_328p.h" to ledarray.c file

I made these modifications to following files in the libnerd folder:

Added: io_328p.h to directory.

Added: #include "../libnerdkits/io_328p.h" to all .c and .h files. NOTE: I did not do this the first time and "make" failed to write to the chip.

Changed: mmcu=atmega168 to mmcu=atmega328p in the "make" file.

My command prompt says it is writing to the chip. AvrDude verifies 8950 bytes of flash. Disconnect power and flip programming switch, re-connect pwr but nothing. I believe I have followed the upgrade guide to a T, but I feel I am overlooking something. I am quite new to all this, so please just assume I know nothing.

Any Suggestions?

January 23, 2010
by Rick_S
Rick_S's Avatar

Did you delete the .o and .hex files prior to running make? Sometimes make will not re-compile if it sees the files are already there.

Rick

January 23, 2010
by Farmer
Farmer's Avatar

Yep, I removed them from both the led_test folder and the libnerd folder.

Although the upgrade manual did not specifically say to add the << #include "../libnerdkits/io_328p.h" >> include path to all the .c and .h files in the libnerd directory, I found if I did not add these the "make" execute file would not connect with the chip.

I would think that adding a "link/include" file in the wrong place would just waste memory at best. I have downloaded and extracted "clean" files and made the modifications several different ways to no avail.

January 23, 2010
by Rick_S
Rick_S's Avatar

Are you getting any errors at compile? I know with the new version of WINAVR someone else had a problem with the line

SIGNAL(SIG_OVERFLOW0) {

The SIGNAL statement has been dicontinued and was replaced with

ISR(TIMER0_OVF_vect) {

You could try to update that.

Otherwise, it seems like you have done everything I did when I used a 328p.

Rick

January 23, 2010
by Farmer
Farmer's Avatar

Up and Running...... THANKS!!!!

ISR(TIMER0_OVF_vect) did the trick. All LED's working, even that pesky column #6. LOL

Does the ISR timer work with the 168? Any thoughts on what made the 168 PD2 port go bad? Sorry abt all the questions, but I get the impression you like answering them. :-)

Thanks - The Farmer

January 23, 2010
by N3Roaster
N3Roaster's Avatar

Yes, ISR(*_vect) works on the 168 and should probably be recommended rather than SIG_* in new projects.

January 24, 2010
by Rick_S
Rick_S's Avatar

Not a problem about the questions. I've always heard the only bad question is the one not asked.

As to what may have gone wrong with your 168, it's anyone's guess. It may have been weak from the beginning, or you may have unknowingly done something. It would only be speculation at best.

I would however, modify the led_blink program to output to that port and throw an LED between it and 5v with a 1k resistor in series with it. Make sure the cathode side is to the mcu pin. If the LED doesn't blink, the the mcu is definitely not sinking for whatever reason on that port.

You can still use that mcu, just don't sink on that port.

Rick

Post a Reply

Please log in to post a reply.

Did you know that microcontrollers have two different kinds of memory, program space (flash) and SRAM? Learn more...