Hi,
I have a the same problem with 19200bps Z-Uno can not get correct all bytes
from a Victron Energy Solar Charger that will dump each second some status values.
Anything I can do or help with?
When could get these mentioned DMA version?
Michael
Z-UNO UART at 115200bps
Re: Z-UNO UART at 115200bps
Please give it a try on 2.0.8. Now DMA is used for UART - works perfectly even at 115.2kbps
viewtopic.php?f=3427&t=24573
viewtopic.php?f=3427&t=24573
Re: Z-UNO UART at 115200bps
Have you tried the new 2.0.8?
Re: Z-UNO UART at 115200bps
I am using the UART (Serial0) configured to 115200 bauds to log events. I am observing that about 50% of the events (= receiving bytes) are dropped with revision 2.0.8 compared to revision 2.0.7 (installed mid of December 2016). Since I log just events I can use one of the external interrupts introduced with 2.0.8, but this solution will of course not work if a real serial communication is required.
It would be good to know more about the way the UART is served by the DMA in revision 2.0.8 (e.g. what is the available buffer size, in which situation is the DMA not activated, etc).
It would be good to know more about the way the UART is served by the DMA in revision 2.0.8 (e.g. what is the available buffer size, in which situation is the DMA not activated, etc).
Re: Z-UNO UART at 115200bps
I missed something, but I don't understand how do you log events? Do you log them from Z-Uno? If you use UART0 to output there is no differences between 2.0.7 and 2.0.8. It works sequently byte by byte. DMA is using only for input data. Input buffer is 64 bytes long. It's cyclic. So, if you write 65 bytes before next loop with Serial.read inside it will rewrite itself. Anyway, I can help you with this problem if you can it reproduce and give me code that reproduces that problem.
Re: Z-UNO UART at 115200bps
The UART input (RX) of the Z-Uno is used to monitor events (pulses) generated by an external device. During a pulse the signal voltage is dropped from 5V to 0V for a few micro seconds. If the signal is connected to the the serial input the pulse generates a start bit; the UART registers a byte.
There are about 30-200 pulses generated per minute. And the input buffer is read multiple times per second. So there should be no overflow. However the number of detected pulses (= registered input data bytes) is different between revision 2.0.7 and 2.0.8.
There are about 30-200 pulses generated per minute. And the input buffer is read multiple times per second. So there should be no overflow. However the number of detected pulses (= registered input data bytes) is different between revision 2.0.7 and 2.0.8.
Re: Z-UNO UART at 115200bps
In this case I need a sample of your code.
Re: Z-UNO UART at 115200bps
I tried to create a simplified example using the USB attached serial interface, however without any success for the moment. Either the USB attached serial interface behave different than the serial interface 0 and 1, or it is something with my application that is wrong. I need to investigate further ...
One thing I found however is that the input buffer seems be only 16 bytes, which is substantially smaller than the 64 bytes indicated above by "p0lyg0n1". This can be demonstrated with the following program:
Just open the serial monitor of the Arduino IDE and enter character strings. These strings are immediately returned by the program. If a 15 character string is entered all characters are returned. If a 16 character string is entered nothing is returned. And for a 17 character string one character is returned. I conclude that the serial buffer has therefor only 16 bytes.
Concerning the missing received bytes I will dig deeper into this issue ...
One thing I found however is that the input buffer seems be only 16 bytes, which is substantially smaller than the 64 bytes indicated above by "p0lyg0n1". This can be demonstrated with the following program:
Code: Select all
void setup() {
Serial.begin(115200);
}
void loop() {
while (Serial.available()) {
int inByte = Serial.read();
Serial.print(char(inByte));
}
Serial.flush();
delay(100);
}
Concerning the missing received bytes I will dig deeper into this issue ...
Re: Z-UNO UART at 115200bps
Don't do it with USB;) At this moment only Serial0/Serial1 use DMA for input.