Electronics > Projects, Designs, and Technical Stuff

Much Help needed with 8251 USART Problem.......

(1/3) > >>

homemadecpu1986:
Hi friends.

I have been trying to debug an 8251 UART for 5 days now. In fact 3 of them and they all error the same way. I got 1 from a different source, and the last 2 from a single source.

The problem is when receiving characters from my PC, into a simple system with a CPU + UART.

Most characters are received correctly, but 1 out of 10 or so chars are junk.

I have set up the USART for asynchronous communications, 8 data bits, 1 stop bit, no parity.

I configure Putty for the exact same setting.

I have even tried to test the USART on a breadboard, and do it manually. I still get the same issue.

I am initializing the USART correctly I think, the mode byte is 0x4D, and command is 0x37. This is exactly for 8 data bits, 1 stop, no parity, etc.


I am out of ideas, and this is driving me nuts. The issue was happening with my first 8251, so after a while I assumed it was damaged. Bought another 2. Same issue.

Same issue whether when USART used with CPU, or breadboard.

The only thing I can think of is that I am initializing it incorrectly, but that would be unlikely. I have tried many many times.


If someone has any ideas please let me know. I am getting desperate now.

Thank you and best wishes

Paul

ebastler:
Hi Paul,
You have not talked about the hardware side of things at all. Is this a homebrew computer & UART? Could you share the schematic please, especially showing all connections to the 8251?  (And if it is a homemade/hand-wired design, have you checked that you have indeed made all connections? An open handshake input, for example, could mess things up quite a bit.)

homemadecpu1986:
Hi there. I don't have schematics for the 8251 circuit. Yes it is a homebrew CPU. I can guarantee to you all connections are correct. 100%.

If you look at 8251 datasheet it's all very simple. WR/RD pins. Data bus, chip select and control bit. Nothing major.

But the UART fails even at the breadboard alone....

I have tried debugging this in many many ways. Still the problem persists.

is it likely all 3 UARTS are broken ?

Fraser:
Where UARTs are concerned always make sure the master clock reference is meeting the required specs for amplitude, frequency and noise content. A marginal clock can cause mayhem in serial communications as the link can fail intermittently without any obvious reason.

Fraser

ebastler:

--- Quote from: homemadecpu1986 on August 30, 2020, 05:56:54 pm ---is it likely all 3 UARTS are broken ?

--- End quote ---

You already know the answer to that one, right? Why would they all be broken in the same, subtle way? No, the much more likely reason is that you are not using them quite right.

[EDIT: In view of oPossum's post below, I guess one could argue that they are indeed all "broken", by design... Or that you not using them quite right, but that the chip designers have made it pretty hard to find out what "right" means...  :palm:]

We don't know you level of experience and don't know what you have built. You firmly believe that you have done it right and might hence be blind to some (obvious or subtle) problem in your setup. So the only way forward is for you to share more information. If you have built this yourself and don't have a schematic, maybe you should draw one -- it helps in double-checking that you did not overlook anything.

Also, looking at the more "analog" aspects of the design: Have you measured your supply voltages, ideally also with an oscilloscope to look for unwanted spikes or glitches? Do you have decoupling capacitors (100 nF, leads as short as possible) across Vcc and GND for every chip? Could you share photos of your board(s) and wiring?

Edit: Yes, and Frazer's point too! Please check the clock quality too. (Where does the clock signal come from?)

Cheers, Jürgen

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod