MicroController Training
MicroController Training
Micro-Controller
2
Agenda
Introduction
How to select MCU
Power supply, Clock, Reset
GPIO
Interfaces: UART, SPI, SDIO, I2C, USB, Ethernet
ADC, DAC
Programming/debugging interface
Interact with software team: documents to be prepared
2
Introduction
MicroController is an IC programmed to do specific tasks.
Microprocessors Microcontroller
3
How to select
Step 1: Make a list of required hardware interfaces: UART, I2C, SPI…
Step 2: Examine the software architecture (RTOS, Linux, Android…), collect inputs from SW
Step 3: Select the architecture: ARM/8051/AVR32…, 8/16/32 bits, Floating point, speed
Step 4: Examine power consumption (uA/MHz , standby , sleep current)
Step 5: Identify Memory Needs: Flash/RAM/EEPROM, size
Step 6: Start searching for microcontrollers
Step 7: Examine Costs and Power Constraints
Step 8: Check part availability
Step 9: Select a development kit (SW team)
Step 10: Investigate compilers and tools (SW team)
4
Power supply for MCU
Max current consumption
Decoupling capacitors
Power sequence
Power sequence should be as per datasheet
5
Clock and Reset
Crystal
6
GPIO
GPIO configuration Design consideration
Input:
o Floating or pull-up/down
o VIL, VIH
Output:
o Types: Push-pull or Open-drain
o VOL, VOH
o Output current
o Total current of all Outputs
8
Interfaces
SPI/SDIO
Considerations:
- Voltage level (DC analysis)
- Length matching
- Serial resistor + decoupling cap on SCK , near Master
- Rise time / Fall time (AC analysis)
9
Header of section
SDIO layout
10
Interfaces
I2C
Considerations:
- Voltage level (DC analysis)
- Pull Up resistor calculation.
- Serial resistor + decoupling cap on SCL , near Master
11
Header of section
USB
Applications:
- Communication from / to an computer (OS based)
- Connect to Storage device (USB thumb drive)
Considerations:
- Connector type
- Power can be taken or provided from USB connector
- ESD protection
- Differential pair signal.
- Serial resistors (Imp matching)
- Pull up resistor ( depend on USB mode / MCU spec)
- Common mode choke
- Load SW with current limit (USB host)
12
Header of section
UART App:
- RS232 interface
- Wireless connectivity module (Wifi,Bluetooth,LoRa,2G,3G,Zigbee)
- Sensors
Considerations:
- Voltage level (DC analysis)
- HW handshaking.
- Baud rate: to <1Mbps (9600, 19200,115200 are popular values)
- ESD protection for connector
13
ADC (Analog to digital converter)
Questions to be prepared
PRIMARY
• What is the required level of system accuracy? (type of ADC, errors, number of bits ,…)
• How many bits of resolution are required?
• What is the nature of the analog input signal? ( amp , freq, differential ?)
• How fast must the converter operate (conversion speed)?
SECONDARY
• Does the system have multiple channels?
• Does the system need conversion timing, need DMA ?
• Should the voltage reference be internal or external?
• Is it require an amplifier / filter externally ?
14
Header of section
16
Header of section
Considerations:
- Pull up/ down resistors
- Serial resistors , length matching.
- ESD protection
- Data Speed
- Voltage level
- Standard connector: Design as Evaluation board. Test points are not preferred.
17
Header of section
JTAG
JTAG, 4/5-wire interface for programming , boundary scan and debugging, using the pins TRST ,TCK, TMS,
TDI, and TDO.
Speed : 10MHz to 100MHz
Pull up/down
18
Header of section
SWD
SWD 2-pin serial wire debug interface for programming and debugging
Using the pins SWCLK and SWDIO
SWD: pull up on SWDIO , Pull down on SWCLK
Speed : to 4Mbps
Reset pin may required as an additional signal.
19
Header of section
UART/RS232
• UART debug interface for programming and debugging
• Using the pins RxD and TxD
• If Serial bootloader is used on an UART port, this UART port must be selected.
• Speed : to <1Mbps (9600, 19200,115200 are popular values)
• If RS232 is used , it required a voltage level translator (such as MAX3232).
• For complex systems (especially Linux OS) , UART port is often used as console port, HW
must provide UART port.
20
Header of section
Output:
- MCU pin mapping.
21