Discussion in "Project Help" started by    msideal    Oct 16, 2014.
Tue Oct 28 2014, 10:48 pm
#21
thanks ExperimenterUK for your help.... I will try this and let you know.
Cheers......
Tue Oct 28 2014, 11:04 pm
#22
ExperimenterUK: Thankyou so much for helping me.... Its working perfectly..........


[ Edited Tue Oct 28 2014, 11:37 pm ]
 ExperimenterUK like this.
Wed Oct 29 2014, 11:06 pm
#23
Thank you for the feedback.
It's good to hear when we've helped


Mon Nov 03 2014, 09:16 pm
#24
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....
Tue Nov 04 2014, 06:44 am
#25
Use
IN R28,PINA ; READ PORT A
not
IN R28,PORTA
Tue Nov 04 2014, 12:02 pm
#26
I change it. But now non of the leds are glowing when pressing a switch
Wed Nov 05 2014, 09:55 am
#27
I want to give some inputs here but I do not understand why you're comparing data from PortA with 0x02?

	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
#28


I change it. But now non of the leds are glowing when pressing a switch

msideal


The simulation works for me
Because you compare with 2, only switch 1, or none, will give an output.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

EdwardFew
Mon Mar 18 2024, 01:14 pm
EmeryPah
Mon Mar 18 2024, 11:51 am
RobertMax
Sun Mar 17 2024, 10:22 pm
DanielJar
Fri Mar 15 2024, 06:52 pm
Tuzaimecor
Fri Mar 15 2024, 02:32 am
PromotionFoode
Thu Mar 14 2024, 08:11 pm
EdwardGeawn
Sun Mar 10 2024, 12:24 pm
ZacharyShado
Sat Mar 09 2024, 10:04 am