AT90CAN128- AVCC pin as INPUT

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo all I am using AT90can128 avr uc, i am using a board where a push button is connected to avcc pin, How can make it as input? Many thanks in advance. In the image s2 push button is the input which I want to use. Thanks in advance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

If your talking about S2, it is connected to /Reset, not AVCC!

AVCC is the VCC pin for the analog section of the AVR, it is not a data input pin.

 

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you Jim,  How can I use pushbutton as input if it is connected to reset? I couldn't able to find it in manual:  I mean in programming point of view..

Last Edited: Fri. May 19, 2017 - 06:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Well you can't unless you rewire the switch to a port pin.  Perhaps, remove diode D7, then you can add a jumper from the switch to a port pin.

Enable the internal pull up resistor on that port pin, reading the PIN register for that pin will be high when the button has not been pushed,

and low when the button is activated.

 

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some AVRs, not sure if that includes this one, have an RSTDSBL (reset disable, or something like that) fuse that turns the reset pin into a GPIO pin. However, once you do that, you CANNOT use most of the standard serial programming & debugging interfaces. One of the regulars on here used to have a signature line that approximately said:

 

Want to live dangerously? Enable RSTDISBL!

Note that the schematic shows the RST pin as used by JTAG. JTAG would no longer function if you enable that fuse!

 

Jim 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
Some AVRs, not sure if that includes this one, have an RSTDSBL

I don't think this model does, so we cannot tease OP any more in this direction. ;)

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My recommendation is to just add an external switch and be done with it. That is a reset switch and it is not going to funciton as a GPIO switch without board change.

 

If you are willing to hack the board, you can unsolder D7 or cut the trace between D7 and the switch, then wire the switch to a different pin.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net