Is UART included in main ZX Core?

nihirash
Mensajes: 102
Registrado: 04 May 2019, 00:55
Contactar:

Re: Is UART included in main ZX Core?

Mensaje por nihirash » 31 May 2019, 15:55

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.
My hardware:
ZX Uno 4.2, +UNO, ZX-Evolution Rev. C+VDac+ZXM-SoundCard Extreme+ZiFi, Harlequin 128K, Reverse U8, Leningrad 48K

My blog(and there gopher server on 70th port): https://nihirash.net/

Avatar de Usuario
yombo
Mensajes: 486
Registrado: 05 Oct 2015, 14:10

Re: Is UART included in main ZX Core?

Mensaje por yombo » 31 May 2019, 15:59

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)
Última edición por yombo el 31 May 2019, 16:39, editado 1 vez en total.

Avatar de Usuario
yombo
Mensajes: 486
Registrado: 05 Oct 2015, 14:10

Re: Is UART included in main ZX Core?

Mensaje por yombo » 31 May 2019, 16:04

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. ;)

nihirash
Mensajes: 102
Registrado: 04 May 2019, 00:55
Contactar:

Re: Is UART included in main ZX Core?

Mensaje por nihirash » 31 May 2019, 16:06

Oh, ok)

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

Sorry, guys :-)
My hardware:
ZX Uno 4.2, +UNO, ZX-Evolution Rev. C+VDac+ZXM-SoundCard Extreme+ZiFi, Harlequin 128K, Reverse U8, Leningrad 48K

My blog(and there gopher server on 70th port): https://nihirash.net/

Avatar de Usuario
aowen
Mensajes: 125
Registrado: 07 Oct 2015, 13:32

Re: Is UART included in main ZX Core?

Mensaje por aowen » 31 May 2019, 17:23

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.

Avatar de Usuario
yombo
Mensajes: 486
Registrado: 05 Oct 2015, 14:10

Re: Is UART included in main ZX Core?

Mensaje por yombo » 31 May 2019, 22:36

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.

Avatar de Usuario
aowen
Mensajes: 125
Registrado: 07 Oct 2015, 13:32

Re: Is UART included in main ZX Core?

Mensaje por aowen » 01 Jun 2019, 19:00

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. ;)

nihirash
Mensajes: 102
Registrado: 04 May 2019, 00:55
Contactar:

Re: Is UART included in main ZX Core?

Mensaje por nihirash » 06 Jun 2019, 19:37

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
My hardware:
ZX Uno 4.2, +UNO, ZX-Evolution Rev. C+VDac+ZXM-SoundCard Extreme+ZiFi, Harlequin 128K, Reverse U8, Leningrad 48K

My blog(and there gopher server on 70th port): https://nihirash.net/

Avatar de Usuario
yombo
Mensajes: 486
Registrado: 05 Oct 2015, 14:10

Re: Is UART included in main ZX Core?

Mensaje por yombo » 06 Jun 2019, 19:51

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!

nihirash
Mensajes: 102
Registrado: 04 May 2019, 00:55
Contactar:

Re: Is UART included in main ZX Core?

Mensaje por nihirash » 06 Jun 2019, 19:55

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:
My hardware:
ZX Uno 4.2, +UNO, ZX-Evolution Rev. C+VDac+ZXM-SoundCard Extreme+ZiFi, Harlequin 128K, Reverse U8, Leningrad 48K

My blog(and there gopher server on 70th port): https://nihirash.net/

Responder