Dear all i have a very simple question on serial data transmission.
signed int NUM;//32 bit
NUM=235;
the serial configuration is:
- 115200 baud rate
- 1 start
- 1 stop
- no parity.
How much time will it take to transmit this number(NUM) over the serial port?
furthermore, I send the data in two ways as follows. My IDE is Keil Microvision. 1> use printf("%d /n", NUM);
2> I have written a function
void Send_Info(uint32 count1)
{
int k;
static uint8 NumPos[6]={0};
NumPos[0]= count1 / 10000 + 0x30; //tenthousand1
NumPos[1]= count1 % 10000 / 1000 + 0x30; //thousand1
NumPos[2]= count1 % 1000 / 100 + 0x30; //hundred1
NumPos[3]= count1 % 100 / 10 + 0x30; //decimal1
NumPos[4]= count1 % 10 + 0x30; //unit1
NumPos[5]= 0x0D; //CR
for(k = 0; k < 6; k++)
{
(void)stdout_putchar(NumPos[k]);
}
}
All transmission happens inside an interrupt which occurs in every 0.5 sec.