How can I dispaly in a seven segment dispaly, with a atmel mega16 , several resistor and swithches, the numbers of 0 to 9, if a use the switches as a input for numbers in binary code, how can i read the 1 or 0 they send to me , in which register they will be located.
Since you want to send the input in a binary code, for 0 to 9 on a seven segment display you would need 4 switches. Just connect the switches one side to the supply(VDD or ground) and the other side to any port pin of the ATmega16. Place all 4 switches this way in 4 consecutive port pins. Also add pullup/pulldown resistors, if the ATmeg16 does not have them already inside. Now just read the binary value directly from the port and make a lookup table which will correlate the binary value to the lines you have to switch in order to drive the seven segment display.
Connect the seven segment display to another port either directly (if the current requirements are within ATmega16 limits) otherwise through a buffer.
Hello
atmega16 has internal pullup resistor for all ports but you dont need to use it for input port , im used portA as input and port B as output to do this and portB to 7447 and segment is connected to 7447, so you can read data from portA but you must select portA as input and portB to output with some code.
Good luck
Added after 45 seconds:
Hello
atmega16 has internal pullup resistor for all ports but you dont need to use it for input port , im used portA as input and port B as output to do this and portB to 7447 and segment is connected to 7447, so you can read data from portA but you must select portA as input and portB to output with some code. and you dont need any resistor.
Good luck