I am trying to make an LCD circuit that, eventually, will control an amplifier and display data to the user through the LCD. One of the features I want to include is the ability to show if the device is plugged via an AC wall adapter, or just a 9V battery. The circuit below is what I have so far. Everything is tested working on the bread-board except for the DC sensing jack.
Here is my circuit:
I am very new to the whole MCU programming thing, so I want to make sure I am on the right track. When I go to the program, will I be able to use pin 29, PC7, on port C to detect the change on my DC in port?
JP2 is the 9V while DC-IN is the wall adapter jack. Pins 2 and 3 are normally closed.
Basically, I want to detect when the user plugs in the DC adapter so I can change an icon on the LCD. When the user plugs in a wall adapter 2-3 on the DC-IN opens and PC7 will no longer have a connection to ground. (if I understand things correctly) That way I should be able to use PC7 to detect a change in R2, the pull-down resistor?
Basically, I still want to use PC0 through PC6 for other I/O stuff like led control and button press detection. I want to make sure that, programmatically, this is possible. That way I can continue my design knowing I can get things working.