UART slow on computer side using LPC1769

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UART slow on computer side using LPC1769

352 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serhangul on Thu Apr 26 08:15:38 MST 2012
Hi,
We are using LPC1769 to transfer data sampled with ADC to computer using a Baud rate set to 115200, which means that  we have Fdiv=13, DLM=0, DLL=13. Our operation is as follows: We take a sample from the ADC and then immediately, we send it to the computer in 2 bytes via UART. We are using a serial-to-usb converter to transmit the data to the computer.
Our ADC sampling frequency is 1.6 kHz, which means that we are sending 2 bytes with a frequency of 1.6 kHz. However, on the computer side we cannot receive those bytes properly. We have measured that we received them with a frequency of 20 Hz, which is way too low.
The code on the computer side is written in C#, we use the interrupt (serialPort1_DataReceived) to take the bytes, we recombine them (merging 2 bytes) and write to a file via Streamwriter.
We are sure that UART can work at this Baud rate, however we can not reach to our desired transmission frequency. What might be the problem? Could it be possible that Streamwriter is working very slowly so that it doesn't allow a fast data transmission?

Thanks a lot for your help.
0 Kudos
Reply
1 Reply

288 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Thu Apr 26 13:08:49 MST 2012
Since this is an LPCXpresso forum and not a C# forum I have to guess (don't use C# myself).
I am guessing that the C# stuff buffers the data and only transfers it to your application when a certain buffer size is filled.

Or ... there is just a problem with your application on the LPCXpresso.
You should measure with an oscilloscope to detect that indeed data is being transmitted at the mentioned intervals (or use a terminal program on the PC to see this). This will then prove that the problem is in your PC application.

Rob
0 Kudos
Reply