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.