![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #16 | |
| Quote:
Hi, ive done that, it still doesnt work. did some debuging and saw the problem. I tried this: test MOVF cPORTA,W ANDLW code1 MOVWF PORTB GOTO test and for some reason what is in code1 is totally ignored. No matter what If i press button 0 light 0 on B lights. Same for button 1. However 2 and 3 never work no matter what. Whatever you set the codeto, 1 and 2 pass the "and" check and nothing else does...confusing. Can you remember the RealCybot site? BTW, yes 2 is zero flag. Last edited by adamscybot; 28th January 2009 at 05:29 PM. | ||
| |
| | #17 |
|
My bad, used ANDLW code1 which obviously wont work. Working code: Code1 MOVF PORTA,W BTFSC STATUS,2 MOVF PORTA,W ANDWF code1,0 MOVWF temp CALL Flag CALL Release RETURN It works!!!!!!!! Flag checks every bit in temp. My problems are solved. Thanks to everyone. | |
| |
| | #18 | |
| Quote:
Sorry, I got here so late this morning. I was just working out how to explain (don't do enough assembler these days...) but I see you got it, on your own. Great job! ![]() Now I can get some more coffee! ![]() PS. Here is a tip for when you post code on here: Surround it with [code] and [/code] tags Last edited by BeeBop; 28th January 2009 at 06:15 PM. | ||
| |
|
| Tags |
| alarm, burglar, checking, inputs |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Burglar alarm help. | compute_a_nerd | Electronic Projects Design/Ideas/Reviews | 10 | 13th January 2009 03:14 PM |
| burglar alarm | yoursoninoz | Electronic Projects Design/Ideas/Reviews | 3 | 23rd March 2007 04:53 PM |
| Burglar Alarm | tauraim | Electronic Projects Design/Ideas/Reviews | 6 | 1st March 2007 11:05 AM |
| Burglar alarm | madmikejt12 | Chit-Chat | 6 | 21st October 2006 12:40 PM |
| burglar alarm | chriz | Electronic Projects Design/Ideas/Reviews | 1 | 21st June 2005 10:17 PM |