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.

Microcontroller Programming » Using Analog Comparator as Input Capture

August 28, 2012
by dan_engbers
dan_engbers's Avatar

So I kept getting the dreaded LCD black lines on 1 and 3 when using PINB0 for Input Capture. I look at huzbum's code, and yea...his project works. Mine? Not so much, through many many iterations of it. I actually thought my sensor was dead toward the end.

In any case, one thing caught my eye and I cannot explain it yet (hint hint, please chime in Mike (mrobbins)). mrobbins said that disabling the pullup would work, but he would be worried about the external timing source pulling the pin low during startup.

Rather than learning about tri-state, low, high mumbo jumbo (I'm tired), and without going into the last few hours of finally working on this, I ended up using the Analog Comparator instead and it works. The problem? The LCD screen uses PIND6 and PIND7. If I use the unit, I'm stuck viewing in a serial session. It's not a huge deal since this project will use digits for readout, but it's nice to have the LCD when troubleshooting and building on.

So all of that to ask this, does anyone have an alternate pinout for using the LCD? Something to free up those ports? Is it even possible?

August 28, 2012
by dan_engbers
dan_engbers's Avatar

Another little discovery...perhaps it's due to lack of sleep?

I remove all reference to the LCD and serial acts up? I'll check to make sure I have the newest library tomorrow but I find that interesting.

When I remove the include for lcd.h and the functions from main() I end up getting "âXª±±½± world!" instead of "Hello world!".

Post a Reply

Please log in to post a reply.

Did you know that using an alternating excitation voltage can reduce the noise in many sensor measurements? Learn more...