General > General Technical Chat
What are you using to interface with microcontrollers?
<< < (3/4) > >>
hans:
Debuggers are often mildly useful, because they halt a program which usually must run real-time.

UART is still pretty common for console, logging or tracing etc. I often use the latter. Console/logging in my view is printing human-readable text over serial so you can see whats going on. This often includes the use of printf() and whatnot, which is often quite slow. For faster routines, you could also use tracing libraries. Segger has SystemView using RTT transport, or you could roll your own library. I did the latter as its integrated in my build system capturing trace messages and then performing the printf on the host machine. The buffer can either be transmitted via an UART or via a debug probe (e.g. RTT).

If tracing is still problematic, then a last resort could be to use a SPI bus at max bitrate, and send individual data bytes for debugging, and trace+decode them with a scope/LA. You could use GPIOs to sync up to the serial stream. Its far more invasive form of debugging, but if you need to trace data from a very short IRQ, it may be the only viable way to do it.

I never bother with USB CDCs for debugging. Perhaps for field diagnostics (such as a serial console with hidden commands), but other than that I would only use USB CDCs for the operational aspect of a board.
Its far easier to use one of the many dozen USB-UART converters (the high-speed FTDI chips can do 12Mbaud+).
NiHaoMike:
If you need many ports, the Raspberry Pi Pico can be programmed to provide 6 of them. What I would like to see is a version of the firmware that also offers I2C and SPI.

--- Quote from: Peabody on December 12, 2023, 04:06:46 pm ---The standard wired communications option in the Arduino world is a USB-to-UART adapter using the FT232RL:

https://www.ebay.com/itm/256072581134

It requires a driver at the computer end, but in Windows it shows up as a COM port.  Don't know about Apple.  The adapter can also provide power to the microcontroller, and has a jumper to set 3.3V or 5V.  These work quite well, but baud rates are limited to about 115,200 I think.

--- End quote ---
Official Arduino stopped using FTDI long ago, instead they switched to a second microcontroller programmed to perform that function.
Smokey:

--- Quote from: NiHaoMike on December 13, 2023, 01:51:13 pm ---...
Official Arduino stopped using FTDI long ago, instead they switched to a second microcontroller programmed to perform that function.

--- End quote ---

... This sometimes leads to a bizarre situation, where the dedicated USB<->UART uC is actually more powerful than the application processor on the Arduino board.
tooki:

--- Quote from: Peabody on December 12, 2023, 04:06:46 pm ---It requires a driver at the computer end, but in Windows it shows up as a COM port.  Don't know about Apple.

--- End quote ---
They show up as a standard serial port on the Mac (as /dev/ttysomething, with the something being the name of the bridge device). Same as Linux. A driver may or may not be needed, depending on the OS version and device.
amwales:
I use the CH430 USB-to-UART, chips are very cheap https://www.lcsc.com/search?q=ch340
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod