HOME AUTOMATION DOUBT
Discussion in "Project Doubts" started by ranjan Apr 5, 2007.
Thu Apr 05 2007, 08:55 pm
HEY RICKEY
i sent an e-mail with the code in assembly.did you find any errors?...i have compiled it using ride and corrected a few like changing acall with lcall.anything wrong with logic?
i sent an e-mail with the code in assembly.did you find any errors?...i have compiled it using ride and corrected a few like changing acall with lcall.anything wrong with logic?
Fri Apr 06 2007, 01:50 pm
I checked your code, the displaying status is a little big.
make it small i give you example....
Instead of above you can do like this...
So you need not to move 0xFF all the time, when reading.
And instead of toggling the LEDs, add some more code and ask for on or off.. will be more nice..
Code seems to be ok! did u test it?
make it small i give you example....
stat:mov p2,#0ffh ;reading port status mov a,p2 rrc a ;if carry then led is on jnc led_0 mov dptr,#msg_2 ;else display led is off again_2:clr a movc a,@a+dptr jz led_11 ;once finished jmp to next led acall t_pc ;routine for display inc dptr sjmp again_2 led_0:mov dptr,#msg_3 ;display led is on again_3:clr a movc a,@a+dptr jz led_11 acall t_pc inc dptr sjmp again_3
Instead of above you can do like this...
stat: ;if carry then led is on jnc P2.0,led_0 mov dptr,#msg_2 ;else display led is off again_2:clr a movc a,@a+dptr jz led_11 ;once finished jmp to next led acall t_pc ;routine for display inc dptr sjmp again_2 led_0:mov dptr,#msg_3 ;display led is on again_3:clr a movc a,@a+dptr jz led_11 acall t_pc inc dptr sjmp again_3
So you need not to move 0xFF all the time, when reading.
And instead of toggling the LEDs, add some more code and ask for on or off.. will be more nice..
Code seems to be ok! did u test it?
Fri Apr 06 2007, 09:19 pm
hey rickey
thanks for checking my code.i have not been able to test it as i have trouble transmitting char. using windows hyperterminal.it does not show what i type.can u suggest any method 4 serial data transmission in windows.
i need to see the status too on my pc.
thanks for checking my code.i have not been able to test it as i have trouble transmitting char. using windows hyperterminal.it does not show what i type.can u suggest any method 4 serial data transmission in windows.
i need to see the status too on my pc.
Fri Apr 06 2007, 11:25 pm
Well you need to activate the option of echo typed characters. Or i have uploaded a small serial communication software. which you can download from the download area in other useful softwares. hope this will help you.
Powered by e107 Forum System