This paper presents an implementation of a fuzzy controller for dc-dc converters using an inexpensive 8-b microcontroller. An ''on-chip'' analog-to-digital (A/D) converter and PWM generator eliminate the external components needed to perform these functions, Implementation issues include limited on-chip program memory of 2 kB, unsigned integer arithmetic, and computational delay, The duty cycle far the dc-dc converter can only be updated every eight switching cycles because of the time required for the A/D conversion and the control calculations. However, it is demonstrated here that stable responses can be obtained for both buck and boost converters under these conditions, Another important result is that the same microcontroller code, without any modifications, can control both converters because their behavior can be described by the same set of linguistic rules, The contribution shows that a nonlinear controller such as fuzzy logic can be inexpensively implemented with microcontroller technology.