Power Electronics Europe Feb/ March 2024

www.renesas.com MICROCONTROLLER DESIGN 23 www.power-mag.com Issue 1 2024 Power Electronics Europe from the peripheral bus to can minimise disturbance of the CPU operation. Other techniques are the use of a distributed clock system and a module stop function on every peripheral. The RA family, for example, also includes on-chip noise filtering on some of the more sensitive inputs, such as reset or oscillator inputs as well as optimising the I/O buffers and the power supply design. The use of an advanced process technology enables the integration of various components that otherwise would have to be located externally. This helps to improve reliability, removing the need for external circuitry such as oscillators and power management devices. The integration of on-chip oscillators, POR/LVD (brownout systems) and watchdog timers on-chip can greatly help in reducing the impact of noise. Addressing the CPU Designers should also consider how fast they need to run the CPU. The maximum speed may be dictated by the baud rate needed for the UART or by the time in which a Fast Fourier Transform (FFT) filter function must be completed. However much of the time, and for many designs, the device does not have to run at its full speed but only as fast as needed to achieve everything required. The higher the clock speed, the faster the signals and the more problems may arise. The slower it runs, the less current is used and switching in the power supply, and the less noise is generated. For example, RA microcontrollers have the capability to throttle their speed. Users can change the clock dividers dynamically if required to speed up and speed down. This can add complexity to an application as users must manage the peripheral clocks, but it is worth considering if the clock speed can be reduced. It is also advisable to check the power supply’s dimensions are correct for the design. Rather than reusing the same power supply circuit, ensure it is capable of supplying the maximum amount of current required. If the supply drops occasionally, this can cause noise issues as well as generate other system problems. Many peripheral input pins also have programmable noise filters. These are commonly found on communication peripherals such as UART, SPI, and I2C interfaces as well as many timer inputs. The correct choice of filter clock selection is important to get the best performance from these filters. Often, this is only achieved through trial and error. Watchdog timers Communication interfaces are connected to the outside world and often bring highspeed signals into the system. The use of external protection circuitry is often advisable depending on the nature of the external environment. Watchdog timers are an excellent method of recovering an application when noise causes a system’s crash. However, it’s important to consider how to use these correctly. For example, there are two watchdog timers in the RA microcontroller design. The first is a standard watchdog timer which can be clocked from several of the standard clock sources on the microcontroller. This watchdog is typically used to check the application’s code execution and to detect any malfunction or unexpected operation. It is typically switched off during low-power applications. This watchdog can generate a reset or an interrupt. The second watchdog timer is the Intelligent Watchdog Timer (iWDT). This uses a dedicated low speed, on-chip oscillator as its clock source, allowing a long timeout and independent operation from the normal CPU clocks. Even if the CPU clock fails, the iWDT will still cause a reset or an interrupt after it times out. Each of the watchdogs can operate with a window function, where a tickle that occurs too early, as well as the watchdog timing out, can cause a reset. Each watchdog can be selected to auto-start after a reset by setting the relevant bits in the option function select register, a flash-based register that holds initialisation data for the device. A common mistake is to place the watchdog tickle inside an interrupt service routine, because only one instance is normally required. This can be dangerous, however, as while the main application may crash, the interrupt system may continue to operate, negating the watchdog. Upon completion of the application, designers should analyse all the possible execution paths. This can be difficult for complex applications using an OS, but modern code analysis tools integrated into modern development tools can help. Multiple instances of the watchdog tickle can be placed at relevant locations throughout the application. This will make the application much more reliable and have the added advantage that it will detect if the application takes an unexpected execution path. This is normally an indication of a serious issue such as a system crash or a pointer overflow. In any system, the best way to avoid noise problems is to consider noise reduction from the beginning of the design. It is important to understand the environment that the system will operate in, what noise sources will be present, and what steps can be taken to mitigate these. It’s always worth spending some time to consider these issues at the start of the design, as it is much easier to design noise mitigations from the start than to add them at the end of the design - or even worse, modify a design when noise problems are discovered in the field. To receive your own copy of Power Electronics Europe subscribe today at: www.power-mag.com

RkJQdWJsaXNoZXIy MjQ0NzM=