Activity for Lundin
| Type | On... | Excerpt | Status | Date |
|---|---|---|---|---|
| Edit | Post #296603 | Initial revision | — | 21 days ago |
| Answer | — |
A: Error handling in embedded systems The core idea in that design is that the program shouldn't have error handling all over the place, and it should also not make important state decisions all over the place. Those two things should both be centralized somewhere and they are often related. How to design the internals is highly proj... (more) |
— | 21 days ago |
| Comment | Post #296584 |
Suppose that the API would instead have accepted a generic struct where all things a CAN message can contain are included. But then I'd have to expose all of that information even when a certain user is just interested in a limited subset of it all. And maybe copy and shovel that info back and fo... (more) |
— | 23 days ago |
| Comment | Post #296584 |
@#54288 It's because the nature of CAN messages are different depending on peripheral. Most support more or less the same data of up to 8 bytes, with RTR bit and extended id for 11 or 29 identifiers. The user of the HAL can't be allowed to manually write into those buffers because then you expose... (more) |
— | 23 days ago |
| Comment | Post #296580 |
@#54288 My version used a struct `Can` which comes from Microchip's bloat lib register maps below their own would-be HAL called ASF/Harmony, which is very similar to the ST flavour. As I replied to in the comment in my answer is that if you roll out the register map yourself, then you ought to do... (more) |
— | 23 days ago |
| Comment | Post #296584 |
@#54288 If you don't have a struct type for the register then sure, you can do it like that. But a macro is probably preferred. Example `#define UART_SOME_REG(base) (*(base + 1u))` and then all the code in the driver becomes `UART_SOME_REG(UART1) |= SOME_MASK;`. I've written drivers just like th... (more) |
— | 23 days ago |
| Comment | Post #296584 |
@#54288 I don't use git but yes separate repo for all "company standard" files like HALs shared between multiple projects and one repo for drivers. Checked out hard copies of the files then get added to each project, you don't want to be in a position where updates to standard/driver code leads t... (more) |
— | 24 days ago |
| Edit | Post #296584 | Initial revision | — | 27 days ago |
| Answer | — |
A: What exactly is a HAL and how would I write my own? A proper HAL is exactly what it sounds like - a Hardware Abstraction Layer. Meaning code which can execute no matter what underlying hardware that's sitting below it. Hardware includes the MCU itself, naturally. ST's bloat libs is a bad example since they aren't a proper HAL but just a thin wrap... (more) |
— | 27 days ago |
| Comment | Post #296550 |
I wouldn't recommend CERT for embedded systems (depending on your definition of "embedded") like microcontroller firmware etc. MISRA is much more suitable for that. Or the other way around, if you are doing hosted systems programming, CERT is probably more suitable than MISRA - I wrote a Q&A abou... (more) |
— | about 1 month ago |
| Comment | Post #296550 |
A little RL anecdote regarding fool-proof wiring of PLCs... I was part of a big project in the middle of summer, last days before vacation. As I was building this big electric box with multiple PLCs etc, the customer who wanted it called me up and said "you gotta come out on site and wire this fo... (more) |
— | about 1 month ago |
| Edit | Post #296540 |
Post edited: |
— | about 1 month ago |
| Comment | Post #296543 |
These kind of recommendations questions are more suitable for chat. There's an EE chat room at the Codidact Discord. (more) |
— | about 1 month ago |
| Edit | Post #296540 | Initial revision | — | about 1 month ago |
| Answer | — |
A: How do I test firmware code for my embedded system that also controls hardware peripherals? "How do I test" tends to be the wrong question, since the immediate follow-up question to that is always "what are your requirements?". It can't really be answered without knowing the requirements. Regarding testing in general: Tests are often divided in two categories: black box testing vs w... (more) |
— | about 1 month ago |
| Edit | Post #296504 |
Post edited: |
— | about 1 month ago |
| Edit | Post #296504 | Initial revision | — | about 1 month ago |
| Answer | — |
A: Communication with microcontroller via usart - using strings a good idea? Olin has posted a good answer regarding the pros and cons. To add to that, look at where your C code is going: `if(strcmp...) else if (strcmp...)` and so on. This is a common mistake in embedded C when parsing strings, I've scolded a fair amount of programmers for writing super-inefficient code l... (more) |
— | about 1 month ago |
| Comment | Post #295939 |
@#54288 Type safety and enums is a whole chapter of its own - it is indeed easy to mix them up if they have too similar sounding type names etc. This post on SO might be of interest to you: [How to create type safe enums?](https://stackoverflow.com/questions/43043246/how-to-create-type-safe-enums... (more) |
— | about 1 month ago |
| Edit | Post #296367 | Initial revision | — | 2 months ago |
| Answer | — |
A: Transceiver board for recovering pulse shape on SWD signals - avoiding bus contention on SWDIO > The SWD clock frequency is 16 MHz. That's ridiculous, turn it down. You don't need anything beyond 1-2MHz for programming, there is nothing during programming that needs a high baud rate, so it can get turned down significantly. 1MHz might be a good compromise between speed and reliabili... (more) |
— | 2 months ago |
| Comment | Post #296358 |
You can configure Segger J-Like clock just fine, there is nothing that _needs_ a high baud rate. There's no sensible reason to run it at 16MHz during programming, it can get turned down significantly. 1MHz might be a good compromise between speed and reliability. Even for some >100kib project it ... (more) |
— | 2 months ago |
| Comment | Post #296334 |
@#36396 The kind of people who actually bother reading help files are the ones we want to keep, so I doubt that the tone ever had the effect you think it would. Overall there's the "be nice" Code of Conduct which applies to everyone and everything on the site. (more) |
— | 2 months ago |
| Comment | Post #296334 |
I think the guidelines pages could probably do with a bit of overhaul. They give a rather hostile impression currently. For example we can maybe borrow some things I wrote for EE.SE recently regarding boards/modules https://electronics.meta.stackexchange.com/a/10261/6102. The bullet list in part... (more) |
— | 2 months ago |
| Comment | Post #296293 |
War stories would be: avoid BGA, QFN and similar packages like the plague, especially during the prototype stage. Everyone makes mistakes, and there is typically no easy way to patch them and save even a prototype. If there is no other option it might be best to start playing with some pre-made e... (more) |
— | 3 months ago |
| Comment | Post #296267 |
While I don't know much of the topic myself, I suspect that you can find technical definitions and guidelines in IPC 2221 which is a standard for PCBs. I haven't read it myself, but your scenario should be similar to a non-functional pad/via/trace on a PCB, in terms of determining creepage/cleara... (more) |
— | 3 months ago |
| Comment | Post #296050 |
My personal experience of assembly shops of all kinds is that they probably don't complain but just try to get the job done, until you explicitly ask them for layout feedback. They have the best knowledge regarding the risk of "tombstone" for example. At one point I did also get quality problems ... (more) |
— | 5 months ago |
| Comment | Post #296050 |
For the acceptance criteria I believe the IPC610 class 3 would require 75% land filled, something like that. If picking for example the footprint to the left and then go with P&P, stencils and reflow, then whether or not you will pass/fail class 3 wouldn't be obvious to me. For example does the a... (more) |
— | 5 months ago |
| Edit | Post #296032 | Initial revision | — | 5 months ago |
| Answer | — |
A: Using one shared reset signal across two rigid boards connected by flex PCB — good practice or risky? For EMC reasons, it is bad practice to have "TTL-level" signals in general, and resets in particular, to leave the PCB. You only have 90mm which isn't a long distance, so if it is ok or not would depend on your EMC requirements. The kind of circuit you describe is very common with a LCD modul... (more) |
— | 5 months ago |
| Comment | Post #295943 |
Anyway, the tl;dr for all batteries is that most are harmless. But if concerned, you could wear rubber gloves when cleaning up the mess, using a wet tissue. You can throw the gloves and tissue in the regular garbage. Put the batteries in a plastic bag and bring them to the recycling center. Wash ... (more) |
— | 5 months ago |
| Comment | Post #295943 |
There is a [Recycle](https://proposals.codidact.com/posts/291189) proposal in the incubator. This question would be on-topic if posted there as a Q&A with that proposed tag. (more) |
— | 5 months ago |
| Edit | Post #295939 | Initial revision | — | 5 months ago |
| Article | — |
Designing a state machine/task scheduler for MCUs Background This is a brief tutorial with examples for how to set up and design a simple "bare metal" microcontroller program consisting of a finite state machine, or a task scheduler or similar. It is common that we find ourself with the need to execute functions in a certain order. Either... (more) |
— | 5 months ago |
| Comment | Post #295823 |
Yes this is how you do it if you want to ground the screw to board/supply ground, we do the same. But if the screw connected there is grounded to chassis, it means that board ground = chassis ground and you have no other option than that. Depending on the application, you may want multiple connec... (more) |
— | 6 months ago |
| Edit | Post #295807 | Initial revision | — | 6 months ago |
| Answer | — |
A: Assembly challenges for shared pad between mounting hole and resistor The zero ohm resistor only needs to be there in the first place if connection to chassis is optional - if it is mandatory then there's no need for the resistor to begin with. If the resistor is there, then indeed the proposed layout is bad, since the circular copper pour will get paste on it a... (more) |
— | 6 months ago |
| Edit | Post #295112 |
Post edited: For some reason 2 tags for the same thing existed |
— | 6 months ago |
| Comment | Post #295563 |
@#117033 Veteran users of SE are rather discussion a final exodus from there due to to bats*** crazy ideas the company keeps spitting out on SO. It really seems like the final nail in the coffin - right now would be the worst of times to try out SE. Personally I'm finally leaving the place, good ... (more) |
— | 7 months ago |
| Comment | Post #295552 |
I have very little experience of flex PCB but the key seems to be which IPC standard that's referred to for the dielectric layers. This site seems to have lots of good info: https://pcbsync.com/ipc-4204/ (more) |
— | 7 months ago |
| Comment | Post #295483 |
@#54288 Hi there. That's a bit off-topic for Codidact, but feel free to join the [EE chat over at SE](https://chat.stackexchange.com/rooms/15/electrical-engineering). (more) |
— | 7 months ago |
| Edit | Post #295493 |
Post edited: |
— | 7 months ago |
| Comment | Post #295485 |
> but manufacturers don't seem to have lists that do the reverse
Generally they don't but here I have to give credit to one of my favorite manufacturers Vishay - they actually do this for every type of component they ever sold. You do have to know the type (diode, capacitor etc) then go to htt... (more) |
— | 7 months ago |
| Edit | Post #295493 | Initial revision | — | 7 months ago |
| Answer | — |
A: What is this SOT-23 part? I suspect it might be TI/National part: LM385M3-2.5/NOPB which is a SOT23 2.5V ref IC. But you have to hook it up as per that datasheet with crocodile clips and a bench supply to know for sure - if it gives out a 2.5V at pin 1 then I would assume it is indeed the correct part. > In general, ho... (more) |
— | 7 months ago |
| Edit | Post #295483 | Initial revision | — | 7 months ago |
| Answer | — |
A: Cutoff frequency of lowpass filter for AVcc Another option entirely is to add a voltage reference IC. There are two flavours of those: "series reference" and "shunt reference". Simplified, the former is a linear regulator of sorts and the latter is a zener diode of sorts. An article from AD here: Series or Shunt Voltage Reference? As no... (more) |
— | 7 months ago |
| Comment | Post #295326 |
The normal way to dodge spurious RF emissions picked up from the product itself would be to sprinkle small decoupling caps on the lines, somewhere in the 47pF - 100pF range. However with very high baud rates those values may still be too large and affect the signals, making the edges too round. W... (more) |
— | 8 months ago |
| Comment | Post #295313 |
@#54288 Some connectors have specified number of operations even though that's rare. It is mostly the fine pitch in combination with no strain relief that makes it bad - a 2.54mm header strip does not have these problems at all and neither does the ribbon cable that goes with it, like the old JTA... (more) |
— | 8 months ago |
| Comment | Post #295313 |
@#64549 That sounds reasonable but then I don't think they need much in the way of layout considerations if you have already decided to go with a lower baud rate. It's a bigger concern to make sure they don't disrupt other parts of the board, like some analog section. (more) |
— | 8 months ago |
