NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » Realtimeclock1.c program fails to display result on LCD with ATmega328P
August 28, 2011 by vgphotog |
The interrupt handler sei() seems to disable the LCD display when using the ATmega328P. I have just changed over to the ATmega328P from the ATmega168. I have tested most of the basic programs that came with the nerd kit and they work but the display failed to work in a program that I am writing to test the capacity of rechargeable batteries. After much trouble shooting I have discovered that the failure comes from the code that I am using from the realtimeclock1.c program. So I loaded the into the 328 and it also fails to display a result on the LCD. If I comment out the sei() about six lines from the end of the program the display is active and displays zero. Of course the program will not function as intended with that line commented out. I seems that some way sei() disables the LCD. The display remains completely blank if sei() is not commented out. What can I do to make this program work with the ATmega328P? "LCD with sei() commented pic"
|
---|---|
August 28, 2011 by missle3944 |
Hi vgphotog, Change line 56
TO:
I just had that problem about an hour ago ,too. -Dan |
August 28, 2011 by vgphotog |
Dan thank you very much, that fixed it. Where would I have been able to find this information and possibly other fixes for the 328 |
August 29, 2011 by SpaceGhost |
Well, Ralph and I had some dialog a while back in which we discovered this same issue: Forum Topic - Nerdy Stopwatch / Kitchen Timer. Here I posted my modified version of the realtimeclock.c project... Trouble was, the code worked for me but not Ralph. Noter figured it out for us and offered the same fix that Dan provided you. And yes, part of the issue involved the fact that I was using the '168, and Ralph was using the '328P... Then Rick posted some additional information to the thread. He suggested that we replace
with
What we learned from Rick was that "The SIGNAL syntax has been depreciated ( LINK ) and replaced by ISR." Rick also stated "that is also why the vector name changed. The reason SIGNAL still works is that interrupt.h still handles both but it may not in the future." Rick referenced this snippet from interrupt.h -
Please check out the "Nerdy Stopwatch / Kitchen Timer" thread for an interesting and more detailed explanation of this topic! |
Please log in to post a reply.
Did you know that a piezoelectric buzzer can be used to play music with your microcontroller? Learn more...
|