This is the first time to write blog to how to learn microcontroller program, if find any problems, to let me know. I hope that the file will help you to learn the microcontroller program. But if you don't have the C lanuage knowledge, this file will not suitable to you.
In this file I will take the freescale microcontroller at the example one to show you, I think the microcontroller is that just to make the knowledge of that you have learned to implement. But at first I want to declare, this file is not to tell you how to program the driver step to step, just to tell you how to from nothing to finish the designment.
First: Requirement Analysis
- The production will be designed to whom. such as vehicle, family electric etc.
- What functions do the production need.
- Analysis the functions need waht the microcontroller modules.
- Through the modules, then select the most suitable microcontroller, including the modules, price,etc.
Then, introduce the MC9S12G-Family of micro controllers.
Chip-Level Features
On-Chip modules available within the family include the following feature:
- S12 CPU core
- Up to 240 Kbyte on-chip flash with ECC
- Up to 4 Kbyte Eeprom with ECC
- Up to 11 Kbyte on-chip S-RAM
- Phase Locked Loop (IPLL) frequency multiplier with internal filter
- 4-16 MHz amplitude controlled Pierce oscillator
- 1 MHz internal RC oscillator
- Timer module (TIM) supporting up to eight channels that provide a range of output compare, counter, and pulse accumulatr functions.
- Pulse width modulation (PWM) module with up to eight x 8-bit channels.
- Up to 16-channel, 10 or 12-bit resolution successive approximation analog-to-digital converter (ADC)
- Up to two 8-bit digital-to-analog converters (DAC)
- Up to one 5V analog comparator (ACMP)
- Up to three serial peripheral interface (SPI) modules
- Up to three serial communication interface (SCI)modules supporting LIN communications
- Up to one multi-scalable controller area network (MSCAN) module (Supoorting CAN protocol 2.0A/B)
- On-chip voltage regularation (VREG) for regulation of input suppply and all internal voltages
- Autonomous periodic interrupt (API)
- Precisionfixed voltage reference for ADC conversions
- Optional reference voltage attenuator module to increase ADC accuracy
Second: Hardware Design
After select the micro controller, then design the peripheral circuit, this is very important. Before design the HCM, the first understand the system and need to control all of the devices. the second is that the HCM need to satisfy with the standard, such as EMC, ISO etc. This module is not the software enginner's responsibility, but the hardware design affact to the software design, so when at the moment of hardware design, be best the software engineer need join to it.
Third: Software Design
To software engineer, this is the most important process. After I will introduce the micro controller software designment. If you have any problems, welcome to discuss with us.