Private Function negotiate() As String Dim nego As String = Chr(6) + Chr(48) + Chr(53) + Chr(49) + Chr(13) + Chr(10) sp1.Output(nego) End Function
THIS IS A vb FUCTION,i need to send this string in assembly lnaguage from 8051 through serial port, first character is ACK, i dont understand how to send ACK, and CR and LF in assembly, the receiver sysem requires ASCii data, can i put their HEX values?? i tested the system with hyper terminal, and sent ctrlF for ACK,and it worked. can i use MOV, A, '^F' lcall TRANS TRANS: SETB TR1 MOV SBUF,A ;load SBUF
HERE: JNB TI,HERE ;wait for the last bit
CLR TI ;get ready for next byte RET
will it be treated as ACK? 'value has been trucated to 8 bits' this is assembler's response
secondly, the receiver works with 7 data bits and even parity, how do i select thses settings using 8051
I WANted to define a string for the request, negitiation and password frame for the receiver, the negotiate frame is like this 'ACK 0 5 1 CR LF' how can i define it as NEGo: DB '?? 051 ??'
Have you spent any time googling for ASCII table? Then you should know the numeric values for your control characters. And when you play with DB, the assembler don't care if the data you enter represents specific ASCII characters or are numbers for some math algorithm. So you can enter the numeric values you did find in the ASCII table.
I DID CHECK the ascii tables, for ack, soh, stx etc, we have hex, dec value of 6 for ACk, and the character is ctrlF, which shows a symbol on hyper terminal and works fine, but doesnt appear when i program in assembly...and if i send a 6 in place of ACK, would the receiver take it as ACK? or the number 6??? i am getting errors
Note the difference between a byte storing the numeric value 6, and a byte storing the character '6'.
oh, i just realized that, thankyou... plz tell how can i make serial settings for 7 data 1 parity bit in 8051??? beacuse ascii format supports 7 bits, and my receiver has been set for that. for mode 2 of serial settings, there r 8 data bits
You really need to study the available materials before posting.
For a start, the clearly stated instructions on how to post source code:
www.danlhenry.com/.../keil_code.png
Then, the Datasheet for your particular chip will tell you what modes its serial port supports, and how to configure them.
For general background on the 8051 family, see: www.8052.com/.../120112 http://www.8052.com/tutorial