Comment on Missing data when communicating over UART
j4k3@lemmy.world 1 week ago
You need a little $5 FX2 board based logic analyser and the FOSS software PulseView to see the data.
You should check that baud rate is matched. In particular, you may need to look at the clock rates of the chip and how its PLL is divided. Back in the day, you actually had to pick the correct crystal frequency to match things like a desired baud rate. Now, most hardware is more tolerant of differences. When you are dealing with more simple hardware, it still matters.
bvoigtlaender@feddit.org 1 week ago
I will definitely get an logic analyzer, looks like it will come in handy more times than one. Thanks for the recommendation.
Even though I expect it too be too quickly really debug it (?!). Ill try to get some more info about what the CTS of the module actually says when sending stuff.
I was hoping that the error was a bit more high level than that though most of the data is actually being received fine. I have edited the post and have attached a log showing the problem.
j4k3@lemmy.world 1 week ago
This is the one you want with 16 channels Image
j4k3@lemmy.world 1 week ago
So one of the tricks I learned from reverse engineering the 3 layer PCB of the Nintendo Game & Watch anniversary Mario handheld, is that the engineer(s) that designed the board routed ground traces between every single line. Every button, and every signal had a ground trace around it with very few exceptions. I was given some low quality xrays of the board after I had already retraced the entire thing using continuity and vias. I then pieced together the internal routing using the xrays.
My point is that all signals on a board include a magnetic component. Electrons actually flow backwards from ground because all electrons have a negative charge. We think of conventional current flow from positive to negative, but that is technically incorrect. There is a magnetic field that is created by that flow, and the size of issues this field creates are primary determined by any additional distance traveled between the signal and ground.
Additionally, you may have brown out conditions periodically impacting one peripheral. Something like a UART module seems like a small thing, but back in the 1980s, that was an entire chip on a board of a microprocessor. It has a ring buffer and several registers. It may be causing issues when these are loaded up with high values. Try increasing the capacitance on your power rails to see if that solves the problem.
I do not know the output configuration. If it is an open collector, where pull up resistors are used, you need to select the best resistor value to get sharp edges. You may need to check that the logic low value is within the required range of values. You could put a Schmitt triggered buffer in between the devices to see if sharp edges improve performance like with a 74(x)2G17 for a modern 2 gate surface mounted option or with a more old school 74(x)241. The (x) is the series, which you select for architecture and speed. For almost everything, you will be using CMOS 74 series, and in most instances, 74HC will be fast enough. Generally speaking, 74LS is only compatible with old bjt stuff, 74HCT is for converting between LS and HC type stuff, and most LS and HC stuff will not work together. The static HC stuff is MUCH lower power and what most chips use. You just need to be sure to match the power to your devices. This page will help you find logic stuff for this type of issue: en.wikipedia.org/…/List_of_7400-series_integrated…. It is totally overkill, but tossing in a buffer with sharp Schmitt triggered edges is a quick hack to see if your issue is potentially related to RLC or grounding.
For the FX2 chip. They come in 2 varieties. Don’t get the one in the little enclosure with just 8 lines. There is another cheap board that is bare and has all of the chip pins broken out and labeled in the solder mask. This one works with up to 16 channels. It can be super handy to see all the extra signal lines or create extra trigger signals.
The actual developer of Pulse View has a tutorial here: www.youtube.com/watch?v=dobU-b0_L1I