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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/05/11 01:03
Read: 4060 times


 
#181691 - Intel 8051 RS-232 Interface and fingerprint module !!
Hello there

I want your help about this program. I have a device that I must sent one packet which consists of 25 bytes via serial interface (rs-232) using 8051 micro-controller and after the package received form the device it responds with another packet (25 bytes).

For example I must sent something like this:
7E 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 (25 bytes)

and after that I must receive something like this:
7E 00 00 00 01 00 00 00 01 00 00 00 0A 00 00 00 00 00 00 00 00 00 00 00 0C

I wrote this program and now I want to see the packet that the device sent to host (8051). But I can't see it complete, I only receive the first and the last byte, this is the program, is it anything wrong ?

Thank you in advance :)

ORG 000H

;===================================baudrate==========================================

MOV      SCON,#50H           ; receive enable, 8-BIT, 1 STOP BIT.
MOV      TMOD,#20H           ; timer 1 in 8-bit auto reload.
MOV      TH1,#0FDH           ; baud rate 9600.
SETB     TR1                 ; Start Timer 1
ANL      PCON, #01111111B    ; SMOD = 0
;======================================================================================

MOV      R0,#25
MOV      DPTR,#TABLE

NEXT:
MOV      A,#0
MOVC     A,@A+DPTR
CLR      TI                  ;Clear TI.
MOV      SBUF,A              ;Send the content of ACC to Serial port
JNB      TI,$                ;Pause until the TI bit is set.
INC      DPTR
DJNZ     R0,NEXT

MOV      R2,#25

NEXT1:
JNB      RI,$                ;Wait for 8051 to set the RI flag.
MOV      A,SBUF              ;Read the character from the serial port.
MOV      P2,A                ;Echo the content of ACC to P2
CALL     DELAY
CLR      RI                  ;Set the RI=0 for getting the next byte
DJNZ     R2,NEXT1

;==============================
; DELAY 0.5S
;==============================
DELAY:
MOV     R5,#5
DL2:
MOV     R6,#200
DL1:
MOV     R7,#249
DJNZ    R7,$
DJNZ    R6,DL1
DJNZ    R5,DL2
RET

;==============================
TABLE:  DB 7EH,00H,00H,00H,33H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,1AH,00H,00H,00H,00H,00H,00H,00H,4EH
END 



List of 77 messages in thread
TopicAuthorDate
Intel 8051 RS-232 Interface and fingerprint module !!      Vaggelis Triantafillou      04/05/11 01:03      
   I want to see the packet      Andy Neil      04/05/11 02:00      
   Comments      Andy Neil      04/05/11 02:05      
      MTS-51 8051 Microcomputer Trainer      Vaggelis Triantafillou      04/05/11 02:57      
         A what?      Andy Neil      04/05/11 03:23      
            please help !!      Vaggelis Triantafillou      04/05/11 04:06      
               Never wait until "it works"        Per Westermark      04/05/11 04:46      
                  I do it      Vaggelis Triantafillou      04/05/11 05:32      
                     RE: "must work to continue writing code"      Andy Neil      04/05/11 06:15      
                     you got a very positive reply      Erik Malund      04/05/11 06:32      
               You need to provide the information!      Andy Neil      04/05/11 05:44      
               P2      Andy Neil      04/05/11 05:55      
   that old?      Erik Malund      04/05/11 06:34      
      No - not that old!      Andy Neil      04/05/11 06:47      
         80C51RD+      Vaggelis Triantafillou      04/05/11 07:15      
            But what about those displays??      Andy Neil      04/05/11 07:58      
               7-Segment LED displays      Vaggelis Triantafillou      04/05/11 08:20      
                  That raises further questions      Andy Neil      04/05/11 08:55      
                     BCD to 7-segment decoder      Vaggelis Triantafillou      04/05/11 09:18      
                        But still no answer - repeated identical values?      Per Westermark      04/05/11 09:29      
                           DELAY      Vaggelis Triantafillou      04/05/11 09:34      
                              And you're surprised that you miss characters?!      Andy Neil      04/05/11 09:57      
                                 Yes you are right but      Vaggelis Triantafillou      04/05/11 10:06      
                                    Think about it      Andy Neil      04/05/11 12:03      
                                       too busy to think ?      Erik Malund      04/06/11 06:22      
                                          Coding is the LAST thing you should do!      Andy Neil      04/06/11 06:47      
   Interesting article about fingerprint recognition      Andy Neil      04/06/11 04:51      
      Thank you very much      Vaggelis Triantafillou      04/06/11 12:53      
         Nothing to do with nitgen      Andy Neil      04/06/11 15:55      
            yes I have read...      Vaggelis Triantafillou      04/07/11 01:45      
               Again,      Andy Neil      04/07/11 03:05      
                  ok, I am listenig to you..      Vaggelis Triantafillou      04/07/11 13:15      
                     Serial Comms      KONSTANTINOS L. ANGELIS      04/07/11 13:43      
                        Σας ευχαριστώ κύριε Αγγελή για την      Vaggelis Triantafillou      04/08/11 04:29      
                           BEFORE you start coding...      Andy Neil      04/08/11 05:54      
                           Thinking before coding      KONSTANTINOS L. ANGELIS      04/08/11 09:59      
   Thank you very much..      Vaggelis Triantafillou      04/12/11 09:03      
      Standard byte-by-byte loop      Per Westermark      04/12/11 09:13      
         is this ok ?      Vaggelis Triantafillou      04/12/11 13:41      
            Table bytes comparison      KONSTANTINOS L. ANGELIS      04/12/11 16:41      
               Does 8051 has two DPTR ??      Vaggelis Triantafillou      04/13/11 06:19      
                  Same DPTR if you don't have two      Per Westermark      04/13/11 06:57      
                  Please crarify settings of board/device      KONSTANTINOS L. ANGELIS      04/13/11 07:33      
                     for the moment...      Vaggelis Triantafillou      04/13/11 07:52      
                  WHY ON EARTH      Erik Malund      04/13/11 07:51      
                     Yes I know what they are...      Vaggelis Triantafillou      04/13/11 07:54      
                        Why even keep the received data in an array?      Per Westermark      04/13/11 08:17      
                           Please read....      Vaggelis Triantafillou      04/13/11 08:25      
                              I have - have you?      Per Westermark      04/13/11 08:52      
                                 Yes please      Vaggelis Triantafillou      04/13/11 09:21      
                                    you can't store in code memory      Erik Malund      04/13/11 09:33      
   Is this code ok ??      Vaggelis Triantafillou      04/13/11 10:07      
      Wrong focus for comments - and untested code      Per Westermark      04/13/11 10:45      
         I have tested !!      Vaggelis Triantafillou      04/13/11 11:00      
            do you have that much external RAM?      Erik Malund      04/13/11 11:09      
            No. You think you have tested but not multiple turns      Per Westermark      04/13/11 11:33      
            Experimenting with 8051 embedded      KONSTANTINOS L. ANGELIS      04/13/11 15:56      
               thank you...      Vaggelis Triantafillou      04/14/11 12:18      
                  Here we are again....      Vaggelis Triantafillou      04/26/11 03:46      
                     take a look !!      Vaggelis Triantafillou      04/26/11 09:58      
                        Baudrate      Per Westermark      04/26/11 10:25      
                           thanks      Vaggelis Triantafillou      04/26/11 10:57      
                           yes, but better      Erik Malund      04/27/11 06:56      
                              Question      Vaggelis Triantafillou      04/29/11 02:04      
                                 difference between ORG 000H and ORG 113H      Andy Neil      04/29/11 04:03      
                                    usually.....      Vaggelis Triantafillou      04/29/11 06:31      
                                       Now do you understand...      Andy Neil      04/29/11 12:33      
                                 ORG is not an instruction, it is ...      Erik Malund      04/29/11 12:38      
                                    PLEASE SEE THIS AND HELP !!      Vaggelis Triantafillou      04/30/11 04:18      
                                       Copied "END" without first reading what it meant?      Per Westermark      04/30/11 05:09      
                                       step-by-step mode      KONSTANTINOS L. ANGELIS      04/30/11 05:25      
                                          thank you      Vaggelis Triantafillou      04/30/11 05:30      
                                             Assembler way is difficult      KONSTANTINOS L. ANGELIS      04/30/11 08:34      
                                                Thank you.....      Vaggelis Triantafillou      04/30/11 10:24      
                                                   Step through the examples      KONSTANTINOS L. ANGELIS      04/30/11 11:25      
                                                      Of course      Vaggelis Triantafillou      04/30/11 12:12      
                                                         THANK YOU ALL      Vaggelis Triantafillou      05/02/11 03:22      

Back to Subject List