We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
this is my code for serial communication using 8051 iam trying to send letter B on serial port but iam not getting any thig on heperterminal though all setting are ok .so not getting what the problem is.
ORG 000H MOV TMOD,#20H MOV TH1,#0FAH MOV SCON,#50H SETB TR1 MOV A,#'B' ACALL DELAY A_1: MOV SBUF,A H_1: JNB TI, H_1 CLR TI SJMP A_1 DELAY: MOV R0,#255 L1: DJNZ R0,L1 MOV R1,#255 L2: DJNZ R1,L2 RET end
Clearly your induction classes don't include the proper use of apostrophe's
That's normally one I'm quite careful of.
Whoops - Silly me!
"you can only claim a statement is true if you have the proof."
No.
You can claim anything you like - it's getting other people to believe you that tends to require the proof...!
;-)
"That's normally one I'm quite careful of."
Or should that be, "That's normally one of which I'm quite careful" ?
Or not?!
Wow, you're good!
For years now, I've been described as fussy, pedantic and having various other similar traits.
I can see now that I am just an amateur ;-)
Hi "LA p",
It's likely too late for the answer, nevertheless I want to tell you that there is NO "real" bug in your piece of code and it should work without problems. And it really works in the Keil debugger. Note: you must just realize that the sent character WON'T APPEAR IMMEDIATELY in the Serial Window after the instruction "MOV SBUF, A" has been carried out. The time of its appearance depends on Baud rate, so you must carry out quite a lot of 'idle' steps at H_1 ("JNB TI, H_1"). (You can insert a breakpoint on "CLR TI" and run the simulator at full speed). My advice: Commenting your code is a very good practice (I myself mostly write quite detailed comments) but in this case the code is very short, practically self explained and in fact described in your text above it. The only missing important information is the clock frequency used, therefore it's impossible for us to determine the Baud rate. You also haven't told us any particulars concerning the used "hyperterminal", its setup, etc. As to the code itself, I can't find any reason for the delay loops. In my opinion they are completely useless here (btw. only one register, either R0 or R1, might have been used).
To Erik Malund:
1."Anyhow one of the problems you have is that you are not aware of how TI works, you mix 'knowledge' of interrupt driven UART in with your polled routine."
2.another issue is that a timer does not drive the UART if it is not running
Ad 1) ??? Erik, I'm sorry, but I haven't noticed anything concerning interrupt driven UART in that code! What did you mean?
Ad 2) and what is "SETB TR1" then?
To Silly Saussage:
LED diode... ;-)
As to the term 'baud rate': 'Baud' [Bd] is a name of a unit named after Emile Baudot, 'rate' means a speed. In my opinion(!), the word 'baud' just specifies it closer and baud itself doesn't mean the same as the word 'rate'.
Best regards Eric
'Baud' [Bd] is a name of a unit named after Emile Baudot, 'rate' means a speed.
Eric,
Try using google and doing a define:baud
Far more often than not, you'll get something along the lines of 'unit of signalling speed' and 'number of bits per second'.
When I last got stopped by the police for speeding, they said I was doing 39MPH in a 30MPH zone, they didn't say I was doing 39MPH speed in a 30MPH speed zone.
Change that to 'if I were to get stopped by the police' ;)
But at least the definitions claiming "number of bits per second" should be ignored since that is a very bad definition.
I tried Google before I answered, of course. I must confess that even the 'unit named after Emile Baudot' has been pasted from Wikipedia (you may have noticed that ;-), even though I knew that fact before. On the other hand, Wikipedia (not talking about Google or Internet itself) is not fully trustworthy source...
To Per Westermark: 'baud rate' and 'number of bits per second' or, to be more precise, [Baud] and [bits/s] are DIFFERENT things, both meaningful. Unlike [Baud], which includes "all costs", i.e. START-bit, STOP-bit, parity bit, etc., the unit [bit/s] means only the 'useful' information (the character itself) transferred per second.
Best regards, Eric
No, baud contra bits/s shouldn't consider bits including/excluding start/stop bits. It is the number of symbol transitions per second, so it might be the same as bits/s, but for example high-speed modems transfers more than one bit in each symbol by using phase and amplitude, i.e. bits/second is higher than your baud measure.
That is why I claimed that definitions equalizing bits/s and baud are wrong.
You are right.