Thanks Jesper I know my circuit was a bit bare & rude, and could not get any ruder, I did think about the short on the output lines killing a micro port, but mainly the port has the ADC on them, The read made module from http://www.futurlec.com/ has the buzzer on port D and the real time clock, Port C has the LCD on it and the EEPROM, Port B is used for programming it. Thank you for the advice, I quickly soldered the Keypad up before I went to work one morning, now the weekend is here I will redo it properly adding in resistors. Were you say "Set values 0xE0, 0xD0, 0xB0, 0x07 on PA4..7 and watch PA0..3 for a low to see which key is was." I think there is a typing error and 0x07 should be 0x70, But I was thinking of Setting values 0x10, 0x20, 0x40, 0x80 on PA4..7 and watch PA0..3 for a high to see which key is was. The keypad I have is a telephone type 3*4 alphanumeric with a 1*4 A to D column. what I program it for could be numbered, I could do a long press for numbers short press for letters and two and three short presses for 2nd and 3rd letter, but one has to look at the cheap quality of the rubbish keypad and how long before maximum key bounce, I might go better for a "two button" press to get the letters, press A and another key to get the first letter, B and anther button to get the second button From Eric ----- Original Message ----- From: "Jesper Hansen" <jesperh@telia.com> To: <AVR-Chat@yahoogroups.com> Sent: Saturday, February 19, 2005 2:31 AM Subject: Re: [AVR-Chat] The keyboard > Hi what a failure the project is. > > I was planning to put a 4*4 keyboard on portA of a ATmega32, sending F0 to > the data direction register & > the data port. > > this is the "test" plan, to put 1's on all the rows, the loop will look > for a 1 on the columns, when it > finds a 1 the beeper will beep, then I will continue to write the code so > to put information on the LCD > from the keyboard after strobbing the rows one by one. Bad plan, the inputs are floating. Assuming rows are on PA4..PA7 and columns on PA0..PA3 : Write 0xF0 to DDRA to set PA0..PA3 as inputs and PA4..PA7 as outputs Write 0x0F to PORTA to activate the pullups on PA0..PA3 and set all rows low. Read PINA and AND with 0x0F, if the result is different from 0x0F, a key is pressed. Set values 0xE0, 0xD0, 0xB0, 0x07 on PA4..7 and watch PA0..3 for a low to see which key is was. > > I got it to work alright on the studio program, it loops round looking for > a 1 on the columns, but it > fails when I download it to the micro, > I have got the port lines going direct to the keyboard, should I put say > 10K resistors on the input > ports? or use some other hardware ideas? > > > > From Eric > > > > > > > > > > Yahoo! Groups Links > > > > > > > > Yahoo! Groups Links
Message
Re: [AVR-Chat] The keyboard
2005-02-18 by Eric
Attachments
- No local attachments were found for this message.