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 10:06
Read: times


 
#181700 - please help !!
Responding to: ???'s previous message
Andy Neil said:
Don't just expect people to know what that is - provide a link!


http://www.kandh.com.tw/products_2.php?prod=124

this trainer has at P2 a 7 segment display, How many digits? How is it connected?


It has 10 digits.

Only if you write appropriate code to do so!

yes but I think that I wrote the code right but something is missing that I can't find it, this is the reason that I need some help !!

Besides which, that instruction is not used anywhere in your code!


Yes in this example there isn't but But no matter.


You're missing the point!

Νο Ι am understanding you very well, but I give you a link to see where is used, believe me if the code works I will make all comments.

The comments in your code need to describe what you are trying to achieve by that code.


I think here is that you want my friend. Thank you for all your help !! :)

	
;THIS PROGRAM IS TRYING TO SENT A PACKET OF 25 BYTES TO A FINGERPRINT MODULE IN ORDER TO CONNECT WITH IT.

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
;======================================================================================

;=======================send the characters from the table to serial port==============	
	MOV	R0,#25                  ;move the number 25 to R0 in order to take the 25 bytes from the table.
	MOV	DPTR,#TABLE             ;Load the destination address to data pointer
NEXT:
	MOV	A,#0                    ;sent zero to ACC
	MOVC	A,@A+DPTR               ;this command takes the first char from table
	MOV	SBUF,A                  ;sent this char to serial port
	JNB	TI,$			;Pause until the TI bit is set.
	CLR 	TI    			;Clear the TI bit before send another character
	INC	DPTR                    ;increase data pointer in order to take the next char
	DJNZ	R0,NEXT                 ;decrease R0 and if not equal to zero jump to NEXT label
;======================================================================================

	MOV	R2,#25                  ;move the number 25 to R0 in order to take the 25 bytes from the serial port.
NEXT1:
	JNB 	RI,$  			;Wait for 8051 to set the RI flag.
	CLR 	RI		        ;Clear the RI bit after in order to receive first byte from serial port
	MOV 	A,SBUF			;Read the character from the serial port.
	MOV	P2,A                    ;sent the char to P2 where is a 7 segment display
	CALL	DELAY                   ;call delay 0.5 second
	DJNZ	R2,NEXT1                ;decrease R2 and if not equal to zero jump to NEXT1 label

;==============================
; DELAY 0.5S
;==============================
DELAY:
	MOV	R5,#5
DL2:
	MOV	R6,#200
DL1:
	MOV	R7,#249
	DJNZ	R7,$
	DJNZ	R6,DL1
	DJNZ	R5,DL2
	RET
	
;=========================================the table of 25 bytes========================================
TABLE:	DB	7EH,00H,00H,00H,1AH,00H,00H,00H,01H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,1BH
	END
 



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

Back to Subject List