Opinion on Embedded Systems Interview Responses

Thread Starter

Kittu20

Joined Oct 12, 2022
511
hi,
So what is the bitrate per second for the two examples?

E
I guess the bit rate depends on how many bits are transmitted per signal change. Increasing the number of bits per signal change increases the bit rate, even if the baud rate remains the same.
 

ericgibbs

Joined Jan 29, 2010
21,444
I guess the bit rate depends on how many bits are transmitted per signal change.
Hi,
How will the bitrate change based on the number of characters transmitted.??

Consider a 10 bit Byte, 1 start, 8 data,1 stop and the baud rate is 9600, with a logic Bit change state signalled by 1 bit.

How many Bytes can I transmit in 0.5ec and 1sec, and what would the bitrate per sec be for both 0.5Sec and 1Sec?

E
 
Last edited:

WBahn

Joined Mar 31, 2012
32,855
Interviewer: Can you tell me what the baud rate refers to in UART communication?

Me: The baud rate is basically the speed of data transmission or reception. It’s how fast the data is being sent or received.

Interviewer: So, what does a baud rate of 9600 mean?

Me: At 9600 baud, it means the device can send or receive 9600 bits every second.

Interviewer: What’s the bit rate then?

Me: I'm not sure but I guess it tells us the time device takes to transfer or receive a single bit.

I want to get your opinion- specially on last answer
Baud rate is the symbol rate, while bit rate is the data rate.

For a binary system in which one symbol conveys one bit, the two are nearly the same. But not quite. 9600 baud means that 9600 symbols are transmitted per second. But not all of those symbols convey data. In the case of 8 bits and no parity, you have a start bit and a stop bit (assuming 1 stop bit), so it takes 10 symbols to convey 8 bits. If frames are sent back to back, then the bit rate is

(9600 symbols/second)(8 data bits / 10 symbols) = 7680 bits/second = 7.68 kbps

The distinction becomes much more pronounced when each symbol carries multiple bits of data and also when more non-data content (such as timing and error-detection/correction) is added.

The hardware guy works with symbols, so they care about the symbol rate. The end user cares about transferring data, so they care about the bit rate.
 

Papabravo

Joined Feb 24, 2006
22,083
From the article posted by @Papabravo


So the start bit, stop bit, and parity bit are not counted. Which means the bit rate is less than the baud rate.
Whether the communications are synchronous or asynchronous the framing or overhead bits are not relevant to the primary distinction which is how may bits are represented by a symbol.
 

WBahn

Joined Mar 31, 2012
32,855
From the article posted by @Papabravo


So the start bit, stop bit, and parity bit are not counted. Which means the bit rate is less than the baud rate.
For a binary symbol, that will be the case. But, in general, there are two factors that are competing with each other. We have to pay a penalty in order to have (acceptably) reliable communications, so we have framing bits and checksums and error-detection/correction and addressing and all kinds of other non-data stuff that gets transmitted. On the other hand, we often use a channel that can support multiple data bits each symbol.

It's really not even meaningful to talk about baud rate being more or less than the bit rate since they are simply different units. It's like talking about an object's height being more or less than their mass. They are simply different things. They are linked by a conversion factor that relates the two for a specific situation by indicating how many data bits there are per symbol, and that conversion factor can be either greater than one or less than one bits/symbol.

To make things even murkier, the data rate depends on what level in the communications system you are talking about (which is one reason, not the only one, that the people working with the physical channel like to use symbol rate and not bit rate for their discussions). At the end of the day, the purpose of a communications link is to transfer data at an acceptable rate. Everything that impacts that has to be factored in, from the impact of things like compression, encryption, and channel coding, to things like the impact of delay-bandwidth product and whatever type of ARQ protocol might be being used. Since these factors are typically spread out across several layers in the communications link, they are often characterized as an efficiency factor for each layer (and the efficiency can be greater or smaller than unity -- compression is a common example of higher-than-unity compression). When done that way, the "data" is considered to be whatever stream of bits the next-higher layer delivers, which almost always have significant overhead bits included. But the current layer neither knows nor cares -- that impact is captured by the efficiency factor for that higher layer.
 

ericgibbs

Joined Jan 29, 2010
21,444
hi kittu
This is accepted method of bitrate calculation.

The transmission bitrate of a Universal Asynchronous Receiver/Transmitter (UART) is determined by its baud rate, which is measured in bits per second (bps):
E

Baud rate Common
bps 4800, 9600, 19.2K, 57.6K, 115.2K, 230.4K, 460.8K, 921.6K, 1000K, 1500K
The baud rate is calculated using the formula: Baud = number of bytes x total bits per frame x output rate of message (in Hz). The total bits per frame includes data bits, a start bit, a stop bit, and a parity bit if used.

Both ends of a UART connection must use the same baud rate, frame structure, and parameters to ensure the same bit timing.
 

Thread Starter

Kittu20

Joined Oct 12, 2022
511
I have prepared a self-note on how UART works, and I have posted a question at end , need opinion on my understanding

In UART communication, the sender device first sets the line to logic high (idle state) and When the sender want to transmit data, it pulls the line low to send the start bit, indicating the beginning of a new data frame. The receiver, which is constantly monitoring the line, detects this transition from high to low and knows that data transmission has started.

The sender then transmits the data bits one at a time, setting the line to either logic low or logic high , depending on the data. The time period for each bit is determined by the baud rate. The receiver, using the baud rate, determine the timing period and knows exactly when to sample the line to correctly read each bit at those intervals.

After sending all the data bits, the sender sets the line back to logic high to send the stop bit, indicating the end of the transmission. The receiver monitors the line for the stop bit, and once it detects the logic high, it knows the entire data frame has been received successfully.

For example, if the baud rate is 9600 bps, and the time period is 104 microseconds, What exactly happens during this 104 microseconds in UART communication? Specifically, is this the time frame during which the sender sets the line, and the receiver reads the line state?
 

ericgibbs

Joined Jan 29, 2010
21,444
hi,

The sender then transmits the data bits one at a time, setting the line to either logic low or logic high, for 104 microseconds, for every Hi or Lo
E
Update:, added a PIC d/s clip @Kittu20
Note the example where the PIC system clock is 16MHz and the Baud rate is 9600, stating a 25 PIC clock pulses/bit period is expected for a High or Low period.
EG57_ 2286.png
 
Last edited:

BobTPH

Joined Jun 5, 2013
11,521
It's really not even meaningful to talk about baud rate being more or less than the bit rate since they are simply different units. It's like talking about an object's height being more or less than their mass
Hmm. I thought both were in bits per second. That sounds like the same units to me.
 
Last edited:

WBahn

Joined Mar 31, 2012
32,855
Hmm. I thought both were in buts per second. That sounds like the same units to me.
Baud is in symbols per second.

The distinction is clear only when a symbol carries more than one bit.

For instance, for phase-shift keying, you could have three bits determine the phase of the output signal as being one of eight possible phases. If the output signal changed one thousand times a second, you would have 1000 baud. But you are transmitting at the rate of 3000 bits per second, though the final data rate is likely lower due to overhead. Powerline ethernet can use 4096-QAM to get 12 bits/symbol and ADSL can use 32768-QAM to get 15 bits/symbol.
 

Thread Starter

Kittu20

Joined Oct 12, 2022
511
hi,

The sender then transmits the data bits one at a time, setting the line to either logic low or logic high, for 104 microseconds, for every Hi or Lo
E
Thanks Eric, okay during the 104 microseconds time period, sender set the line to either logic low or high, and I guess at the same time, receiver read the logic state of the line.

Does the receiver monitor and read the line's logic state at same time?
 

ericgibbs

Joined Jan 29, 2010
21,444
Hi kittu,
Note my previous update, in which the Receiver expects 25 MCU clock pulses per Hi or Lo Bit period.

Ask you a question:
What risks are there in transmitting a very long, continuous data stream.?
E
 

WBahn

Joined Mar 31, 2012
32,855
Okay, so when you’re sending a long data stream over UART, The receiver may miss data if it can't read incoming bytes fast enough.
What does it mean that it can't read bytes fast enough? It has to be able to read the signal at least one each symbol period otherwise it can't receive anything, no matter how long or how short it is.

This is an example of a follow-up question that would almost certainly convince the interviewer that anything you had said before amounted to little more than memorized strings of words. The issue associated with long frames in UART-based links is something that anyone that actually understands how the link works should be able to jump on immediately.
 

MrChips

Joined Oct 2, 2009
34,818
Somebody once said, "Imagination is more powerful than knowledge".

Having knowledge is certainly a good thing. It is more important to be able to think outside the box and to be able to come up with new answers to a problem that you have not encountered before. In other words, learn to think for yourself (without the internet and ChatGPT).
 

Ya’akov

Joined Jan 27, 2019
10,238
Bit vs baud rate is a silly distinction, if you ask me. I am not even sure what it neans. It may be the max rate at which data bits are sent, not counting start, stop, and parity bits. Who knows?
Baud rate is the symbol rate. It cases where symbols only convey a single bit, such as the Bell 103A modem, baud rate is the same as bit rate because bit rate equals baud rate times bits per symbol. In cases where the modulation scheme can add bits to the symbols, such as QPSK which has two bits per symbol, the baud rate is one half the bit rate.
 

Ya’akov

Joined Jan 27, 2019
10,238
Baud rate is the symbol rate. It cases where symbols only convey a single bit, such as the Bell 103A modem, baud rate is the same as bit rate because bit rate equals baud rate times bits per symbol. In cases where the modulation scheme can add bits to the symbols, such as QPSK which has two bits per symbol, the baud rate is one half the bit rate.
Sorry, I didn’t see there were more responses. I covered this more thoroughly in this thread.
 

Thread Starter

Kittu20

Joined Oct 12, 2022
511
. In other words, learn to think for yourself (without the internet and ChatGPT).
I completely agree that developing problem-solving skills is essential. I have a few hobby projects in mind that I’m working on, I believe they will help me tackle real-time problems.

Sometimes, I find myself in frustrating situations. For example, I bought an AVR programmer earlier, but trying many times, I couldn't program the AVR controller with that programmer. I bought another programmer, but unfortunately, I didn't find success with that one either.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,444
Hi kittu,
Would you like another shot at answering the question.?:) post#33.

Also, what would you consider the maximum cable length of the TX to RX cable to be at 9600 Baud and would that be OK for say 115200 Baud.

E
 
Top