Back to Basics – Watchdog Timers(WDTs)

WDTs are probably one of the most skipped sections in an embedded system because a first-time firmware engineer firmly believes that the code that they wrote is 100% bug-free. Somehow they feel that it’s not needed because they have put the code through tons of testing and still couldn’t crash the firmware. Seasoned folks will tell you that this is absolutely wrong, users on the field will definitely find ways to break your system. WDTs are an absolute necessity for anything which you ship out.

So what are they basically? A WDT is a type of timer that is used to detect and recover from system hangs. It works by continuously monitoring the system and resetting itself after a certain period of time. If the system fails to reset the timer(meaning it has gotten stuck somewhere) before it expires, the WDT will trigger a system reset or other recovery action. It’s analogous to you petting a dog at a constant interval and the moment you stop or miss the petting, the dog will bark/bite to alert you. Hence the name “Watchdog”.

There are diff variations of WDT. Internal WDTs are something which you find commonly in new-age controllers wherein a certain section on the chip is a dedicated timer to perform the WDT. External WDT variant usually utilises an external chip to perform the same. The general consensus is that for anything mission-critical you use an External WDT, just avoid the hardware locking up in some extremely brutal edge cases if you can afford to have that extra part. WDTs in general are not only used for a hard reset, sometimes can be multi-staged wherein you can trigger Action#1 when Timer#1 runs out via interrupts and so on and give the system to correct it and the last one being a hard reset. Some internal WDTs can be used to trigger an interrupt and then give certain processing clock cycles so that some debug state info can be saved before issuing a hard reset.

It’s an understatement to mention that WDTs are essential. NASA Clementine moon spacecraft in 1994 was a casualty of badly implemented WDT in software whereas Mars Pathfinder had a well-built WDT which saved millions of dollars.

If you liked the post, Share it with your friends!

Back to Basics(With a Twist): SIDAC

SIDAC is a specific type of thyristor that is designed to switch on when the voltage applied to it reaches a certain threshold. It is often used in high-voltage applications, such as in power distribution systems. To understand how a SIDAC works, it’s helpful to think of it as a switch that has three states: off, on, and holding. When the voltage applied to the SIDAC’s gate terminal is below its threshold, the SIDAC is in the off state and does not allow current to flow through it. When the voltage applied to the gate reaches the threshold, the SIDAC switches on and allows current to flow through it. Finally, once the SIDAC is on, it remains in the holding state until the current flowing through it drops below a certain level, at which point it switches off again.

It is similar to a DIAC but with higher voltage breakdown regions and current-carrying capabilities(SIDAC = Silicon Diode for Alternating Current). Its a 5-layer PN junction device as shown in pics. Once breakdown voltage(VBO) is reached, it goes to a negative resistance region when current conduction happens. SIDACs are used in relaxation oscillators which are used to create non-sinusoidal waveforms like triangular waveforms. Here a SIDAC is connected in parallel to a capacitor. Initially, the capacitor charges up and when the voltage reaches the threshold of the SIDAC, it makes the SIDAC discharge to obtain your sawtooth waveform whose timing can be adjusted via RC time constants.

Now for the twist, the first paragraph wasn’t written by me. It was generated automatically by the Chat-GPT3 AI service(built on 175 billion parameters). I just gave it an input to explain what a SIDAC is and it gave me the first paragraph as is. An AI model gave me an answer instantly which would have taken me a couple of hours to read up from different papers and books. I am totally mind-blown by what can be done with the tool. It’s going to be used as a companion tool to improve your efficiency drastically(Think GitHub CoPilot). It’s not correct always, it usually gives plausible-sounding but sometimes incorrect answers. If I ran it a few times, I can clearly see it getting some stuff wrong. But possibilities are endless with this tool and I can’t even imagine what it will become 3-4 generations down the lane. All the low-hanging jobs in future will be taken over by AI, in a similar way to how automation killed a large part of manual labour. Start upskilling yourselves in whatever field you are in or you will struggle in a decade or so.

If you liked the post, Share it with your friends!
1 24 25 26 27 28 58