Página 3 de 6

Re: Is UART included in main ZX Core?

Publicado: 31 May 2019, 15:55
por nihirash
Wow, guys, cool down.
Let's do without mutual recriminations.
I've too tired with wars in Russian speccy user groups.

Uart+ESP is good for me. It works and do what they must do.

Re: Is UART included in main ZX Core?

Publicado: 31 May 2019, 15:59
por yombo
aowen escribió:
yombo escribió:
aowen escribió:As I understand it, there is a separate core with UART support, but it's not robust. This may be of interest: https://github.com/yomboprime/FTP_Uno
Hey, the UART is robust. It is the ESP chip and its firmware that gives problems. Also, my GPL library is big and slow because it is based in Arduino GPL code (hence the need to keep it GPL licensed)

The UART library itself is entirely mine and it is MIT licensed: https://github.com/yomboprime/ZXYLib
A well regarded electronics engineer complained to me that it cannot maintain a constant baud rate. I haven't tested it myself, hence the caveat that this is only my understanding.
It has no receive or transmit buffers and uses hardware flow control (RTS pin) to read 1 byte at a time, that is why it is slow. Otherwise it is robust (no bytes lost)

Re: Is UART included in main ZX Core?

Publicado: 31 May 2019, 16:04
por yombo
nihirash escribió:Wow, guys, cool down.
Let's do without mutual recriminations.
I've too tired with wars in Russian speccy user groups.

Uart+ESP is good for me. It works and do what they must do.
Saying the contrary of what another one says is not war. Just opinions and facts. ;)

Re: Is UART included in main ZX Core?

Publicado: 31 May 2019, 16:06
por nihirash
Oh, ok)

I apparently gave too much meaning to the words and did not understand the tone correctly.

Sorry, guys :-)

Re: Is UART included in main ZX Core?

Publicado: 31 May 2019, 17:23
por aowen
So I got back in touch with the engineer and this is what he said:

"[ESPs] are not ideal but the UART is piss-poor in every respect. It will only work with perfectly clean signals. Basically, a UART shouldn't start receiving a character until a valid start bit has been seen, which means sampling the data line and checking several times over the time of 1/2 a bit-period to make sure it's a valid start bit and not just a noise spike... this process also synchronises to the middle of the bit-period, so that we then sample the data bits in the middle. The Uno and Next UART's don't do this and if a single sample is ever low they assume its the start of the start bit and just read a byte from that point on, even if there wasn't one. So even a few nS of noise on a silent line will cause a spurious byte to be received. There are other problems as well, the next fatal one on the Uno is that there is no data buffering at all, so if the Z80 doesn't read the data as each byte arrives it will lose bytes... I'm not sure but I think it might even be as shit as the Z80 has to read bytes before the next one even starts to arrive."

I think it's important to understand that criticism of someone's work does not equate to criticism of that person as a human being, and that someone's work is not necessarily indicative of the best they are capable of. We all have deadlines and real lives to deal with. Having said that, while I have no way to verify the accuracy of any of the engineer's claims, it doesn't sound very robust to me.

Re: Is UART included in main ZX Core?

Publicado: 31 May 2019, 22:36
por yombo
aowen escribió:So I got back in touch with the engineer and this is what he said:

"[ESPs] are not ideal but the UART is piss-poor in every respect. It will only work with perfectly clean signals. Basically, a UART shouldn't start receiving a character until a valid start bit has been seen, which means sampling the data line and checking several times over the time of 1/2 a bit-period to make sure it's a valid start bit and not just a noise spike... this process also synchronises to the middle of the bit-period, so that we then sample the data bits in the middle. The Uno and Next UART's don't do this and if a single sample is ever low they assume its the start of the start bit and just read a byte from that point on, even if there wasn't one. So even a few nS of noise on a silent line will cause a spurious byte to be received. There are other problems as well, the next fatal one on the Uno is that there is no data buffering at all, so if the Z80 doesn't read the data as each byte arrives it will lose bytes... I'm not sure but I think it might even be as shit as the Z80 has to read bytes before the next one even starts to arrive."

I think it's important to understand that criticism of someone's work does not equate to criticism of that person as a human being, and that someone's work is not necessarily indicative of the best they are capable of. We all have deadlines and real lives to deal with. Having said that, while I have no way to verify the accuracy of any of the engineer's claims, it doesn't sound very robust to me.
The :zxuno: UART samples 4 times per half-bit and also waits for the middle of the start bit:
https://github.com/yomboprime/zxuno-add ... art.v#L176

cc @mcleod_Ideafix (he wrote the UART, I only added the hardware handshake, which I agree is shit because the Z80 is the bottleneck, but didn't bother writing code to manage buffers, after all it is a hobby for me)

BTW I'm also an engineer.

Re: Is UART included in main ZX Core?

Publicado: 01 Jun 2019, 19:00
por aowen
yombo escribió:BTW I'm also an engineer.
I'm a member of the IEEE, but I wouldn't trust me to write a UART routine. ;)

Re: Is UART included in main ZX Core?

Publicado: 06 Jun 2019, 19:37
por nihirash
I'm writing UART+ESP driver in pure assembly(first point - http-client).

I'm already can make http request and dump response to console in ~6kb(including all buffers, 4x8 font and print procedure etc).

If I can - we'll get working vtrd.in client for zx-uno

Re: Is UART included in main ZX Core?

Publicado: 06 Jun 2019, 19:51
por yombo
nihirash escribió:I'm writing UART+ESP driver in pure assembly(first point - http-client).

I'm already can make http request and dump response to console in ~6kb(including all buffers, 4x8 font and print procedure etc).

If I can - we'll get working vtrd.in client for zx-uno
Nice!

Re: Is UART included in main ZX Core?

Publicado: 06 Jun 2019, 19:55
por nihirash
Of course, all sources will be available.

I'm sick a little now and don't work, so as not to embarrass the employer - as long as there is nothing in git. :mrgreen: