Wireless TV Shield Interupts the UART(3) Receiving Data

Discussion related to "under the hood" OpenMV topics.
User avatar
Psilym
Posts: 3
Joined: Thu May 30, 2019 2:13 am

Wireless TV Shield Interupts the UART(3) Receiving Data

Postby Psilym » Thu May 30, 2019 2:35 am

Today, when I have tried the function of uart receiving data, I found that I can receive 00 01 ... 09 in sequence on openmv without using tv.display() function. However, the data gets bad when I use uart.read() followed by tv.dispaly() function. The problem has been solved if I separate this 2 function into different part of the while(True) .
But what behind this phenomenon is what I'm figuring out. Hope to solve the problem.
GoodData.jpg
CodeSegment.jpg
BadData.jpg
User avatar
Psilym
Posts: 3
Joined: Thu May 30, 2019 2:13 am

Re: Wireless TV Shield Interupts the UART(3) Receiving Data

Postby Psilym » Thu May 30, 2019 3:40 am

Now I find the way of separating the two funcs can only alleviating problem, but can not fix it. Only get off the tv.display() can make the data receiving perfect.
User avatar
kwagyeman
Posts: 3829
Joined: Sun May 24, 2015 2:10 pm

Re: Wireless TV Shield Interupts the UART(3) Receiving Data

Postby kwagyeman » Thu May 30, 2019 11:05 am

This is weird. Um, whats the data rate the data is received at? The tv.diplay() method uses SPI and disables interrupts for a while while sending data. Is the UART running very fast?

Here's the display method: https://github.com/openmv/openmv/blob/m ... _tv.c#L540

You aren't using pins it uses right?
Nyamekye,
User avatar
Psilym
Posts: 3
Joined: Thu May 30, 2019 2:13 am

Re: Wireless TV Shield Interupts the UART(3) Receiving Data

Postby Psilym » Fri May 31, 2019 1:06 am

Thank you very much! Your reply exactly explains the problem that we meet. The baud rate we use is 115200 which may be a little fast! Thanks again! :D
User avatar
kwagyeman
Posts: 3829
Joined: Sun May 24, 2015 2:10 pm

Re: Wireless TV Shield Interupts the UART(3) Receiving Data

Postby kwagyeman » Fri May 31, 2019 1:46 am

Hmm, yeah, it probably takes longer than the serial buffer has time to buffer data for before needing to be serviced by the CPU.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests