Post History
They aren't specific to the project, but to the MCU. As long as you use the same MCU for multiple projects, they will be code compatible. Some hardware peripherals are even code compatible between ...
Answer
#2: Post edited
- They aren't specific to the project, but to the MCU. As long as you use the same MCU for multiple projects, they will be code compatible. Some hardware peripherals are even code compatible between different MCU families by the same manufacturer.
Generally, they are different in each and every MCU because:- - No standardization exists. Each company design their hardware as they like, with no consensus or standardization. (Or rationale, for that matter...)
- - Different hardware requires different registers. And a newer version of the hardware by the same manufacturer is not necessarily backwards-compatible.
- Take a timer hardware peripheral as one example: there's so many different features that such hardware could have, from case to case. Input capture, synchronized outputs, PWM abilities, external triggers, down counters, different resolution, numerous different clock sources etc etc.
- - Marketing reasons. Different manufacturers compete by providing the best peripherals. This is especially true since ARM Cortex became industry de-facto standard - those who make ARM CPUs can no longer compete over having the best core, so having the best hardware peripherals have become more important.
- - Core data bandwidth. It makes sense to provide 8 bit registers for a 8 bit MCU, but for a 32 bit MCU it might be more convenient to make them 32 bit. So the register width could be changed for this purpose, no matter what the underlying hardware actually requires.
- They aren't specific to the project, but to the MCU. As long as you use the same MCU for multiple projects, they will be code compatible. Some hardware peripherals are even code compatible between different MCU families by the same manufacturer.
- Generally, registers are different in each and every MCU because:
- - No standardization exists. Each company design their hardware as they like, with no consensus or standardization. (Or rationale, for that matter...)
- - Different hardware requires different registers. And a newer version of the hardware by the same manufacturer is not necessarily backwards-compatible.
- Take a timer hardware peripheral as one example: there's so many different features that such hardware could have, from case to case. Input capture, synchronized outputs, PWM abilities, external triggers, down counters, different resolution, numerous different clock sources etc etc.
- - Marketing reasons. Different manufacturers compete by providing the best peripherals. This is especially true since ARM Cortex became industry de-facto standard - those who make ARM CPUs can no longer compete over having the best core, so having the best hardware peripherals have become more important.
- - Core data bandwidth. It makes sense to provide 8 bit registers for a 8 bit MCU, but for a 32 bit MCU it might be more convenient to make them 32 bit. So the register width could be changed for this purpose, no matter what the underlying hardware actually requires.
#1: Initial revision
They aren't specific to the project, but to the MCU. As long as you use the same MCU for multiple projects, they will be code compatible. Some hardware peripherals are even code compatible between different MCU families by the same manufacturer. Generally, they are different in each and every MCU because: - No standardization exists. Each company design their hardware as they like, with no consensus or standardization. (Or rationale, for that matter...) - Different hardware requires different registers. And a newer version of the hardware by the same manufacturer is not necessarily backwards-compatible. Take a timer hardware peripheral as one example: there's so many different features that such hardware could have, from case to case. Input capture, synchronized outputs, PWM abilities, external triggers, down counters, different resolution, numerous different clock sources etc etc. - Marketing reasons. Different manufacturers compete by providing the best peripherals. This is especially true since ARM Cortex became industry de-facto standard - those who make ARM CPUs can no longer compete over having the best core, so having the best hardware peripherals have become more important. - Core data bandwidth. It makes sense to provide 8 bit registers for a 8 bit MCU, but for a 32 bit MCU it might be more convenient to make them 32 bit. So the register width could be changed for this purpose, no matter what the underlying hardware actually requires.