Do microcontrollers have cache?

  • Thread starter EvLer
  • Start date
In summary, the use of cache in microcontrollers depends on the architecture, with RISC architectures typically utilizing it for faster data processing. However, CISC architectures may not have cache due to the goal of having simpler instructions in the instruction set. The use of cache in RISC architectures allows for faster data retrieval, but can also be affected by unanticipated branches. Additionally, multiple levels of cache can be used, with the smallest and fastest being on the processor itself. The use of cache is based on the performance enhancement it provides and is usually expensive to implement.
  • #1
EvLer
458
0
Do microcontrollers have cache?
 
Engineering news on Phys.org
  • #2
Depends on the uC. RISC architectures typically use cache, but I don't think it's common for CISC architectures. Not sure about that though. Do you have a uC in mind?
 
  • #3
no, not really, just was wondering when someone asked me i could not think if they do or not. But thanks! now at least i know that they may or may not.
 
  • #4
one more question: what is usefulness in NOT having cache or what is used in place of it?
Thanks!
 
  • #5
I googled risc cisc cache tutorial, and got some great hits. Here's the first one:

http://www.laynetworks.com/RISC.htm

The goal with a RISC architecture is to have fewer and simpler instructions in the instruction set. As they say on that web page, ideally your RISC processor should be able to execute one of its instructions per clock cycle, versus many cycles in traditional CISC processors. In a traditional CISC processor, you spend several minor cycles fetching the first part of the instruction, then figure out if there is more to fetch (multi-word instructions like long jumps or add immediates), then mess around some more, then finally perform the instruction.

But since the RISC architecture is aimed at executing one simple instruction per clock cycle, it can gobble up data much faster than a CISC processor, so internal fast cache is used as a pipeline to keep the RISC engine running at full speed. But as with any pipeline architecture, if you get an unanticipated branch, you have to empty the pipe and start re-filling it, which lowers the effective speed of the processor.

You can have several levels of cache, with the smallest and fastest on the processor silicon itself, and an intermediate cache off-chip that is fed by the main RAM section of the motherboard. Since cache needs to be fast, it is expensive to use, and you only use it if you can justify the cost from the performance enhancement angle. With a CISC processor, you usually just have RAM outside and no justification for pipeline cache.
 
Last edited by a moderator:

1. What is a cache in a microcontroller?

A cache in a microcontroller is a small, fast memory that stores frequently accessed data and instructions. It helps to improve the performance of the microcontroller by reducing the time it takes to access data from the main memory.

2. Do all microcontrollers have cache?

No, not all microcontrollers have cache. Some low-cost microcontrollers may not have cache in order to keep the cost down. However, most modern microcontrollers used in complex systems like computers, smartphones, and automotive systems have cache.

3. How does cache improve the performance of a microcontroller?

Cache improves the performance of a microcontroller by reducing the number of times the microcontroller needs to access the main memory. This reduces the access time for data and instructions, making the microcontroller run faster.

4. What are the different types of cache in microcontrollers?

There are three main types of cache in microcontrollers: instruction cache, data cache, and unified cache. Instruction cache stores frequently used instructions, data cache stores frequently used data, and unified cache combines both instruction and data cache.

5. Can cache be disabled in a microcontroller?

Yes, cache can be disabled in a microcontroller. This can be done for various reasons, such as debugging, to ensure that the microcontroller is fetching the correct data from the main memory. However, disabling cache can significantly decrease the performance of the microcontroller.

Similar threads

Replies
2
Views
635
  • Electrical Engineering
Replies
10
Views
2K
Replies
2
Views
1K
  • Electrical Engineering
Replies
13
Views
1K
Replies
1
Views
612
  • Electrical Engineering
Replies
4
Views
764
Replies
9
Views
1K
  • Electrical Engineering
Replies
8
Views
927
Replies
3
Views
1K
  • Electrical Engineering
Replies
7
Views
2K
Back
Top