-3

I have a Vector Nav VN100 IMU sensor that sends data serially UART. I have interfaced it with ATmega32. It receives data (ROLL angel) from the sensor and according to the ROLL angel, it controls a servo motor.

My question, if the sending rate is faster than processing speed of the ATmega32, then some data from the sensor will be dropped. How to overcome this problem?

  • If the data is coming faster, that it can be processed and you cannot change the rate, you have to drop data or use a faster board – chrisl Jul 12 at 12:52
  • @chrisl Is not there any other way such as using buffer instead of dropping data? – mohamed Jul 12 at 12:55
  • Even if you use a buffer. When it is full you need to drop data. What are your exact requirements? Reading data contineously? Or just for a limited time period? – chrisl Jul 12 at 13:35
  • @chrisl just for a limited time – mohamed Jul 12 at 13:39
  • 1
    There were three questions there... how frequently will messages be sent? And how long is each message in bytes? If the baud rate is 921600 but you only receive 1 message per second that is just 2 bytes long and you are using a UART (for example) then probably the answer is "you will be ok". On the other hand if there is a continuous sustained stream of data at that baud rate with no pause in between messages then probably the answer is "you have no chance". There are multiple factors that determine the answer to your question. – GMc Jul 13 at 8:54
1

When using an embedded processor's hardware implemented UART, it is often the case that the rate at which the software processes the data is a fraction of the Gross bit rate some times referred to as the Baud rate. If the UART is configured to handle 8 bit RS-232 where the Gross bit rate is 10000 bits per second, the processor only has to handle data at a faction of that rate. Perhaps 1/10 given several bits of over head and space between characters.

Processor intervention can be further reduced if the hardware UART contains several bytes of buffering. For every doubling of the number of hardware supported bytes of buffering, processor interventions events are cut in half.

Beyond this, there are embedded processors in which the UART supports DMA or Direct Memory Accessing. This is where the hardware UART will write the received data directly into the processor's memory with out need of processor intervention. This feature is usually only found on feature rich embedded processors.

Study this PDF to understand the abilities and limitations of the ATmega32 processor. Specifically the USART section starting on page 140.

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.