![Freescale Semiconductor MPC5604B Quick Start Manual Download Page 94](http://html1.mh-extra.com/html/freescale-semiconductor/mpc5604b/mpc5604b_quick-start-manual_2330604094.webp)
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.
Summary of Contents for MPC5604B
Page 1: ...LAAS CNRS Quick Start to MPC5604B Embedded Development Sahin Serdar 21 06 2013...
Page 31: ...Figure 33 INTC SW HW mode comparison Freescale Tutorial...
Page 87: ......
Page 132: ......
Page 133: ...127 Appendix 2 Pad Configurations...
Page 134: ......
Page 135: ......
Page 136: ......
Page 137: ......
Page 138: ......
Page 139: ......
Page 140: ......
Page 141: ...Appendix 3 Peripheral input pin selection...
Page 142: ......
Page 143: ...137 Appendix 4 Interrupt Vector Table...
Page 144: ......
Page 145: ......
Page 146: ......
Page 147: ......
Page 148: ...Appendix 5 I C Baud Rate Prescaler Values...
Page 149: ......
Page 150: ......