Similarly, an rscanf function was implemented for a scanf like function, reading input until a NUL
character.
5.
Using the UART Driver for a terminal interface
UART can be used for providing a simple human-machine interface using an UART-USB adaptor
(like an FTDI FTR232 or PL2303HX) and a free serial terminal like RealTerm. And then using
the driver from the previous section, one can send orders to the MCU to command its
peripherals. It is only needed to provide a command-line like interface.
The following example provides a simple command-line interface for reading data from ADC and
driving output PWM. Using commands like ‘ADC get x’ for getting data from ADC channel x,
‘PWM start’ for launching a PWM, ‘PWM stop’ for stopping it and ‘PWM DC x’ for setting PWM
duty cycle to x%. And there is a ‘help’ command for explaining these.
5.1.
System initialisation
We wish to set the system clock to 64MHz, power-up SIUL, LINFlex0 (for UART), ADC and
eMIOS(for PWM).
Typical functions for enabling interrupt requests and disabling SWT watchdog are also needed.
5.2.
SIUL configuration
Pins for ADC and eMIOS are to be configured. UART driver configures UART pins by itself.
UART_0 uses pins PB2-PB3. Some LED indicators can be useful too with a write function.
Содержание MPC5604B
Страница 1: ...LAAS CNRS Quick Start to MPC5604B Embedded Development Sahin Serdar 21 06 2013...
Страница 31: ...Figure 33 INTC SW HW mode comparison Freescale Tutorial...
Страница 87: ......
Страница 132: ......
Страница 133: ...127 Appendix 2 Pad Configurations...
Страница 134: ......
Страница 135: ......
Страница 136: ......
Страница 137: ......
Страница 138: ......
Страница 139: ......
Страница 140: ......
Страница 141: ...Appendix 3 Peripheral input pin selection...
Страница 142: ......
Страница 143: ...137 Appendix 4 Interrupt Vector Table...
Страница 144: ......
Страница 145: ......
Страница 146: ......
Страница 147: ......
Страница 148: ...Appendix 5 I C Baud Rate Prescaler Values...
Страница 149: ......
Страница 150: ......