Facing Problem in generating more i/o's by using AVR
Tue Oct 28 2014, 10:48 pm
thanks ExperimenterUK for your help.... I will try this and let you know.
Cheers......
Cheers......
Tue Oct 28 2014, 11:04 pm
ExperimenterUK: Thankyou so much for helping me.... Its working perfectly..........
[ Edited Tue Oct 28 2014, 11:37 pm ]
ExperimenterUK like this.
Mon Nov 03 2014, 09:16 pm
Hi Everyone,
I managed to glow 40 leds for my required work.
Now i want to control the leds with the help of 7 switches. Whenever i press a switch then multiple leds will glow. I am facing problem in my coding. I managed to do it by using one switch but whenever i press another switch. Same combination of leds enlighten.. not different leds glow..
I am attaching my code and simulation....
I managed to glow 40 leds for my required work.
Now i want to control the leds with the help of 7 switches. Whenever i press a switch then multiple leds will glow. I am facing problem in my coding. I managed to do it by using one switch but whenever i press another switch. Same combination of leds enlighten.. not different leds glow..
I am attaching my code and simulation....
Tue Nov 04 2014, 12:02 pm
I change it. But now non of the leds are glowing when pressing a switch
Wed Nov 05 2014, 09:55 am
I want to give some inputs here but I do not understand why you're comparing data from PortA with 0x02?
To check which key is pressed (if you're taking high as key pressed) then simple do ROR (rotate through carry) and then BRCS (branch if carry is set). loop this 8 times for complete port. Do not forget to clear carry flag (CLC) after you find a carry bit set.
IN R28,PORTA ; READ THE DATA OF THE ORDER FROM PORT A CPI R28,0X02 ; COMPARE THE DATA FOR DOWNLOAD FROM C2 BRLO COMBC1 ; IF DATA IS LOWER THAN 2 HEX... THEN GO TO COMBINATION C1
To check which key is pressed (if you're taking high as key pressed) then simple do ROR (rotate through carry) and then BRCS (branch if carry is set). loop this 8 times for complete port. Do not forget to clear carry flag (CLC) after you find a carry bit set.
Wed Nov 05 2014, 11:29 am
I change it. But now non of the leds are glowing when pressing a switchmsideal
The simulation works for me
Because you compare with 2, only switch 1, or none, will give an output.
Powered by e107 Forum System