Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/26/09 08:52
Read: times


 
#165592 - Loops Something like this
Responding to: ???'s previous message
Thank you very much dear Mahesh!This is helpful for me.I've decided to let the comparing part aside for the moment and try to glow a led if i receive a string of 12 bytes starting with 0A and ending with 0D.For that i made some modifications over the code u provided. I tried it on the board but offcourse it did not work :(.Please help me figure out what i did wrong!!

;I am storing received bytes at RAM address 0x40 onwards pointed by R0
;bit 00h indicates reception is going on
;bit 01h indicates reception of full tag ID
Valid_ID: DB 30h,34h,31h,35h,44h,38h,41h,31h,46h,31h   ;this is a valid tag ID


AJMP START

START:  MOV TMOD,#20h
        MOV SCON,#50h
        MOV TH1,#0F4h          ;UART is configured for desired BAUD
        MOV TL1,#0F4h
        MOV SP,#60h    ;Initialise Stack Pointer 
        SETB TR1                       ;Run T1 for BAUDRATE Generation

        MOV R0,#40h    ;init counter

        SETB P2.0                ;the LED must be in off state

WAIT_RX:
               JNB RI, WAIT_RX

               MOV A, SBUF
               CLR RI
               CJNE A,#0Dh,READ_NXT
               SETB 01h                     
               SJMP CHECK

READ_NXT:
               CJNE A,#0Ah, START_RX
               SETB 00h
               SJMP WAIT_RX

START_RX:
               JNB 00h, WAIT_RX
               MOV @R0,A
               CJNE R0,#4Ah,INC
               
INC:
               INC R0
               SJMP WAIT_RX

CHECK:  JNB 01h,WAIT_RX
        SJMP GLOW_LED

GLOW_LED:       CLR P2.0
                SJMP GLOW_LED
END

 



List of 54 messages in thread
TopicAuthorDate
Project using 89s52            01/01/70 00:00      
   RET (Where?)            01/01/70 00:00      
      Loops?            01/01/70 00:00      
         Loops?            01/01/70 00:00      
            with a quick glance            01/01/70 00:00      
               with a quick glance            01/01/70 00:00      
                  search for ...            01/01/70 00:00      
            Loops Something like this            01/01/70 00:00      
               School work?            01/01/70 00:00      
                  Nope            01/01/70 00:00      
               Loops Something like this            01/01/70 00:00      
                  ?...Doesnot Work...?            01/01/70 00:00      
                     ?...Doesnot Work...?            01/01/70 00:00      
                        Correct            01/01/70 00:00      
                        You sure you get a line feed before RFID?            01/01/70 00:00      
                            You sure you get a line feed before RFID?            01/01/70 00:00      
                              Try This            01/01/70 00:00      
                                 Try This            01/01/70 00:00      
                                 error            01/01/70 00:00      
                                    it's bible time            01/01/70 00:00      
                                       it's bible time            01/01/70 00:00      
                                    Is it ERROR or DOUBT???            01/01/70 00:00      
                                       Is it ERROR or DOUBT???            01/01/70 00:00      
                                 Compare            01/01/70 00:00      
                                    Simulate your function.            01/01/70 00:00      
                                       Simulate your function.            01/01/70 00:00      
                                          Use the free Keil C compiler Evaluation            01/01/70 00:00      
                                    COMPARE            01/01/70 00:00      
                                       compare            01/01/70 00:00      
                                          Still not out of time for C            01/01/70 00:00      
                                             Still not out of time for C            01/01/70 00:00      
                                                Read up on pointer            01/01/70 00:00      
                                                   Read up on pointer            01/01/70 00:00      
                                                      Me or you?            01/01/70 00:00      
                                                   Or do not use a pointer            01/01/70 00:00      
                                                      working code            01/01/70 00:00      
                                                         Describe your work process            01/01/70 00:00      
                                                            v            01/01/70 00:00      
                                                               Did you read? Did you debug?            01/01/70 00:00      
                                                         Why dont you define correct id in "code" space            01/01/70 00:00      
                                                            Hoping to get someone relegated?            01/01/70 00:00      
   Reading or Transmitting Data            01/01/70 00:00      
      Reading or Transmitting Data            01/01/70 00:00      
   a trip to the wild blue younder            01/01/70 00:00      
      This is where it gets lost            01/01/70 00:00      
   The fundamental problem is...            01/01/70 00:00      
      Same as its always been,            01/01/70 00:00      
         Yep I cannot think            01/01/70 00:00      
            Yep I cannot think            01/01/70 00:00      
               Why too late?            01/01/70 00:00      
            for a simple task ...            01/01/70 00:00      
               More than one way to skin a cat            01/01/70 00:00      
                  my $0.02            01/01/70 00:00      
                     If you can not code it in ASM ...            01/01/70 00:00      

Back to Subject List