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 » no voltage out from pin 27

June 01, 2013
by rolf
rolf's Avatar

The initialload compiler and code for tempsensor loaded fine but the tempsensor produced no reading on the lcd. So to simplify matters I removed the sensor and the lcd and loaded (again, no problem) the led_blink program. It doesn't work because there is no voltage out from pin 27. I've tried it on two different boards with the same result and am confident that there are no wiring errors. There is the required 5V out from the voltage regulator. With my very limited understanding of all of this, the only thing I can think of is a bad chip. How likely is that? Any other suggestions?

June 01, 2013
by dvdsnyd
dvdsnyd's Avatar

Hi Rolf,

A bad chip is pretty rare. I have done some pretty mean things(unintentional) to my microcontroller,and it still works.

Were you able to get the message on your LCD with the initialload program when you first got going? If it worked before, and now it isn't I would maybe suspect the chip, however if you haven't seen the congratulations message on first boot up, it is likely a wiring issue.

You could try changing the pin on your led_blink program to see if it works on one of the other pins.

Be persistent, troubleshooting these issues can be tough sometimes, but it is rewarding once you get it figured out. Good luck! Let us know what you find out.

David

June 01, 2013
by rolf
rolf's Avatar

Thanks for your response Dave. Yes, I originally got the message on the lcd. Am I correct that pins 23-28 are all 5 volts out? Rolf

June 01, 2013
by dvdsnyd
dvdsnyd's Avatar

Rolf,

Yes, those pins should be sourcing 5 volts when they are enabled... I believe...I am pretty new to all of this too. Maybe some of the more experience guys can jump in and provide some support. I have never seen the issues that you are seeing.

Have you tried rewiring it? I remember before I put everything on prototyping board,wires seemed to become mysteriously loose.

Have you tried to do anything else between now and after the lcd worked before?

Dave

June 01, 2013
by rolf
rolf's Avatar

Having removed the lcd and the resistor and having tried the simplified circuit on two different boards, I am confident that the wiring is correct(I've rewired and checked it many times). I have now tried a couple of the other output pins and they are not working either. Thank you, Dave, for your suggestions. Rolf

June 01, 2013
by Ralphxyz
Ralphxyz's Avatar
  • I have now tried a couple of the other output pins and they are not working either.

So rolf you are able to program the chip to test those other pin output?

How do you know you are successfully programming the chip?

Ralph

June 01, 2013
by rolf
rolf's Avatar

As I noted in my original post, I've been able to load the initial led display, the compiler and the temp sensor and led_blink programs. The compiler lets me know what it has successfully programmed. After removing it from the circuit to simplify matters and make it easier to check the wiring, I reinstalled the lcd and reprogrammed it to display a different message. Works fine. The voltage regulator is putting out 5V and the input pins of the chip are getting their 5V. This leaves only a couple of wires to check and I have done this numerous times.

June 01, 2013
by pcbolt
pcbolt's Avatar

Rolf -

When you first power the MCU (I'm assuming you're using the NK ATmega168) all the port I/O pins are configured as input pins and will not have the pull-up resistors enabled so you shouldn't expect to read 5 volts on them. Once the program on the MCU switches the pins to output mode and specifically outputs a logic 1 on them will you get a 5 volt reading all the time. If you have the pin configured as an input pin and enable the pull-up resistor, you should also expect 5 volts. With the "LED Blink" program, the code sets pin PC4 (#27) to output and sets it to logic 1 (on) waits 1/2 a second and sets it to logic 0 (off) for another 1/2 second. If you were to substitute a voltmeter in place of the LED, the meter may not have time to register 5 volts. You could try changing the code to wait 5000 mSec instead of 500 mSec, that should give a meter plenty of time to get a reading. Were you able to make the changes in the code to test pin 28 (substituting PC5 in place of PC4)?

June 02, 2013
by rolf
rolf's Avatar

I've tried three different pins with the led in place and properly grounded after makiing the necessary changes in the code.

June 02, 2013
by Noter
Noter's Avatar

Post the program that is not working so we can take a look or give it a try on our nerdkit.

June 02, 2013
by rolf
rolf's Avatar

The program is the one I downloaded from the nerdkits website with changes to lines 19, 24, and 30 of the code replacing (1<<PC4) with (1<<PC3). It doesn't output the 5V on pin 26 just as it didn't on pin 27. I've checked the led in other circuits and it's good. I tested pin 26 with a voltmeter after changing the 500 mSec to 5000 mSec in lines 27 and 33. Nothing. The tempsensor program, by the way, loaded fine but no readout appeared on the LCD. So, rare as it may be, I still think it may be that the pins on the right side of the chip are not doing their thing.

June 02, 2013
by Noter
Noter's Avatar

Ok, compile and load this on your chip and see if it turns on your port C pins.

#include <avr/io.h>
int main()
{
    DDRC = 0xFF; 
    PORTC = 0xFF;
    while(1);
}
June 02, 2013
by rolf
rolf's Avatar

Thank you Noter. Adding the two lines to the program turned on the port C pins. What I will soon find out is whether or not I will have to make similar additions to other similar programs (e.g. traffic light). I have yet to retry the tempsensor program which also didn't work the first time around. Rolf

June 02, 2013
by Noter
Noter's Avatar

Glad to help. At least now we know your chip is good and there is something strange going on in the program. The chips are pretty tough, I once had one smoke for a few seconds and even it was ok after I corrected the wiring problem. However it's still a good idea to have a some spares on hand just in case.

Post a Reply

Please log in to post a reply.

Did you know that you can input numbers in binary via a DIP switch, and output them to the LCD? Learn more...