0
\$\begingroup\$

I need to transfer 32 Byte block UART to UART 8 clock cycles per bit 1 start bit Struct 8-E-2 8bits 1 UART char, Even Parity, 2 stop bits/ char

1 + 8 + Even parity + 2 stop bits = 11

efficiency = 8/11 (not sure)

Can any one help me the calculate the shortest time required to transfer?

Assume Micro Controller with 16MHz clock needs to transfer 32 Bytes of data

\$\endgroup\$
  • 3
    \$\begingroup\$ How fast can your UART clock be? \$\endgroup\$ – Ignacio Vazquez-Abrams Nov 3 '14 at 2:04
  • 2
    \$\begingroup\$ 1 + 8 + parity (1) + 2 stop bits =1 12 bits. 12 bits x 32 = 384 bits. Time = 112 / bit rate (per second). You didn't mention your bps rate, so there's no way to calculate the answer. \$\endgroup\$ – Randy Nov 3 '14 at 2:44
  • \$\begingroup\$ What microcontroller or other device are you using? \$\endgroup\$ – tcrosley Nov 3 '14 at 2:59
  • \$\begingroup\$ quartus II microcontroller \$\endgroup\$ – user2971393 Nov 3 '14 at 3:07
  • \$\begingroup\$ @IgnacioVazquez-Abrams 8x - 16x \$\endgroup\$ – user2971393 Nov 3 '14 at 3:21
3
\$\begingroup\$

Time required would be 32 bytes * 12 bits/byte divided by the baud rate. (1 start bit + 8 data bits + 1 parity bit + 2 stop bits = 12 bits). The baud rate is the 'bit clock' that determines how long the bits are. A standard baud rate is 115200 bits per second. This may or may not be the baud rate you're using. Other standard baud rates are 2400, 4800, 9600, 19200, and 38400. If the baud rate is 115200, then the time required to transmit 32 bytes is 32 * 12 / 115200 = 3.33 ms.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Why is parity bit 1 since in the question its mentioned even parity bit \$\endgroup\$ – user2971393 Nov 3 '14 at 4:33
  • \$\begingroup\$ The parity bit is an extra bit that is transmitted along with the data. If you send data 01000101 with an even parity bit, one start bit, and two stop bits, you will actually send 0 01000101 1 11, which is 12 bits in total. Even parity means that if you count up all the 1s in the parity and data, then you get an even number unless a bit got flipped in transit (01000101 1 has 4 ones). \$\endgroup\$ – alex.forencich Nov 3 '14 at 4:48
  • \$\begingroup\$ I got it thanks a ton. How should i confirm the baud rate? \$\endgroup\$ – user2971393 Nov 3 '14 at 4:51
  • \$\begingroup\$ Measure it with an oscilloscope? I have no idea without a lot more information about your device. Generally devices have a baud rate generator (usually little more than a digital divider, though they can use a fractional divider) and by looking at the baud rate generator settings and device clock, you can figure out the baud rate. \$\endgroup\$ – alex.forencich Nov 3 '14 at 4:54
  • \$\begingroup\$ baud rate = (payload bit rate * packet size)/char size.that is 12 * 32 / 8bit(1 uart data char) \$\endgroup\$ – user2971393 Nov 3 '14 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.