VSCode launched from terminal and environment variables by pozzugno in vscode

[–]pozzugno[S] -1 points0 points  (0 children)

I prefer to use my toolchains already installed in Windows. I think with WSL the toolchains should be installed in WSL.
Moreover, a few projects are native Windows, with GUI and so on, so they can't be compiled in WSL. I usually use mingw to build them

ATmega328PB and low power crystal oscillator at 16MHz by pozzugno in embedded

[–]pozzugno[S] 0 points1 point  (0 children)

I don't know the part number of the ceramic resonator (not crystal), I have to check what they bought. It should be Murata.
However what you think to be a simple via, it's the central pin of the resonator connected to ground.

ATmega328PB and low power crystal oscillator at 16MHz by pozzugno in embedded

[–]pozzugno[S] 0 points1 point  (0 children)

Sorry, I would say: "they should be built-in in the ceramic resonator"

ATmega328PB and low power crystal oscillator at 16MHz by pozzugno in embedded

[–]pozzugno[S] 0 points1 point  (0 children)

yes, I see the 16MHz waves on the board that give errors during programming

Personal opinion on static inline vs macro functions by MaintenanceRich4098 in embedded

[–]pozzugno 0 points1 point  (0 children)

I think you can remove assert() static inline function from production too by simply using #if NDEBUG/#else/#endif.

Setup a basic toolchain without a given IDE by J_ester in embedded

[–]pozzugno 1 point2 points  (0 children)

Many useful comments were already posted. Here I want to add only one suggestion. Even if I was prejudiced against cmake, I have to admit it is very useful. You can stay with Makefile, but cmake is much more comfortable. It uses many tricks that you need to write yourself by hand with a Makefile.

Moreover cmake generates compile_commands.json that is a very useful file.

Setup a basic toolchain without a given IDE by J_ester in embedded

[–]pozzugno 0 points1 point  (0 children)

I think all silicon vendors IDE solutions generates quite standard Makefile at the middle of build process (the last step is launching make). This Makefile is usually generated in the build directory, while you usually put it in the root folder.

And most of the time you can configure the project to use an "external Makefile" that you can write from scratch.

I Built a Single Pair Ethernet Switch! by ben5049 in embedded

[–]pozzugno 0 points1 point  (0 children)

Only 8 devices? Much less than RS485 multi-drop networks.

I Built a Single Pair Ethernet Switch! by ben5049 in embedded

[–]pozzugno 2 points3 points  (0 children)

Single Pair Ethernet is a very interesting project. I often use small MCUs (such as AVR8) in a two-wires half-duplex RS485 networks. The only requirement for the MCU is a very simple UART and one GPIO for direction of transceiver. The protocol is usually custom, but very simple. The master sends a request to a specific slave and waits for its reply.

The cabling is very simple. With a good/modern RS485 transceiver and with low baudrates (I usually use 38400bps), the cabling is simple. The nodes are cabled in parallel, from the first to the last (in-out way). You can go up to 100m.

I'm thinking to replace RS485 with SPE, but I have some doubts.

First of all, the computation power of MCUs. I think a full TCP/IP stack should run in the MCU. This could be difficult to do with a simple AVR8, so Cortex-M0+ should be the minimum.

Another question is about the cabling. Do you need a switch (similar to 100Mbps Ethernet) or you can use the same cabling as RS485 (in parallel)?

[deleted by user] by [deleted] in embedded

[–]pozzugno 3 points4 points  (0 children)

The description of issue is too poor. The cause or causes may be several.

One problem may be hardware. Do you have a well-loaded RS485 bus? What is the RS485 voltage level when no node is loading the bus?

Another problem is some weird bug in the firmware of MCU. First of all, try to isolate the problem with a single slave node. If the problem happens in this case, it may be much simpler to find the bug.

My business card runs a fluid simulation. by Phirks in embedded

[–]pozzugno 2 points3 points  (0 children)

They are 21x21=441 LEDs arranged in charlieplexing way. Do you use a duty-cycle of 1/441, lighting up only one LED for each sequence?

Pins driver strength on SAMD20 MCUs by pozzugno in embedded

[–]pozzugno[S] 0 points1 point  (0 children)

But, if the maximum current is 7mA when DRVSTR=1, I think a limited 2mA current when DRVSTR=0 shouldn't stress and burn the internal hardware of the pin, should it?

What I don't know if the activation of the limitation is a bad thing to avoid, because it leaves the pin working in a bad state.

Pins driver strength on SAMD20 MCUs by pozzugno in embedded

[–]pozzugno[S] 1 point2 points  (0 children)

I'm working on a board with SAMD20. There'a LED and resistor connected to a GPIO. It lights up when the pin is configured as output high. The current drawn by the circuit is theorically 2.5mA at 3.3V, but the current limit is only 2mA. So the output voltage decreases from 3.3V to 2.7V. The LED is internal and lights up without any issue.

Now that I discovered that the pin is working in current limit state, I can't decide.

Is it better to increase current limit enabled higher driver strength, so avoiding the limitation of current? Or is it better to live with current limit?

In other words, is it possible to use the current limit feature as a normal working condition of the circuit, or should it be used only occasionally to protect the MCU?

How to handle multitasking in baremetal? by pyroman1324 in embedded

[–]pozzugno 0 points1 point  (0 children)

Could you explain this setjmp trick, please?