??? 04/04/05 11:07 Modified: 04/04/05 11:14 Read: times Msg Score: 0 -1 Gimmee Code +1 Underrated |
#90946 - try this Responding to: ???'s previous message |
hello dear
if it is matter of just reading five keys than ladder type keyboard will solve your problem,connect dirctly five keys one side two five port pins say from port3.0 to port3.4(pin no 10 to 14) connect other side of switch to 5volt ground,now try following code port0 data 080h port1 data 090h port2 data 0a0h port3 data 0b0h sp data 081h ie data 0a8h tcon data 088h psw data 0d0h b data 0f0h acc data 0e0h tmod data 89h tl1 data 8bh th1 data 8dh tl0 data 8ah th0 data 8ch dpl data 082h dph data 083h org 0000h ljmp program_start ;bypass interupt table org 0030h program_start: mov port0,#0ffh mov port3,#0ffh mov port1,#0ffh mov port2,#0ffh main_keypress: jnb port3.0,keypress1 jnb port3.1,keypress2 jnb port3.2,keypress3 jnb port3.3,keypress4 jnb port3.4,keypress5 jnb port3.5,keypress6 sjmp main_keypress keypress1: ; your function will go here sjmp main_keypress keypress2: ; your function will go here sjmp main_keypress keypress3: ; your function will go here sjmp main_keypress keypress4: ; your function will go here sjmp main_keypress keypress5: ; your function will go here sjmp main_keypress the code is according to asm51 if you want to assemle on a51 change accordingly more over cygnal's c8051f020 is not a better choice for beginners it is very high end derivative of 8051 to start i will recommend atmels 89c51 or 89s51 mcu. kuldeep |