Electronic – Do microcontrollers have cache

microcontroller

I wonder if microcontrollers normally have cache or not.

What is the common case?

If not, what could be the benefit behind this?

Best Answer

Some do, some don't.

Low-end MCUs don't as a general rule. The reason for this is they're pretty simplistic devices with no pipeline or other optimizations. Just a simple 8-bit CPU core connected to address and data buses (usually Harvard architecture). They don't generally run fast enough to get any speed increase from cache as they can read from Flash at pretty much full speed anyway.

Higher end ones, typically most 32-bit ones, such as ARM and PIC32, do have cache. These usually run considerably faster (80MHz as opposed to 16MHz for instance) than little 8-bit MCUs, and as a result they can't read the Flash fast enough, so they have a small amount of cache, and a (usually 5-stage) pipeline, to make the whole system smoother and faster.