EasyManua.ls Logo

Freescale Semiconductor MPC5604B - Chapter 11 I²C: Inter-Integrated Circuit Bus Controller; 1. Presentation of I²C protocol

Default Icon
150 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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.

Table of Contents

Other manuals for Freescale Semiconductor MPC5604B

Related product manuals