Specifications
V850E2/MN4 CSIH Control
R01AN0924EJ0100 Rev.1.00 Page 10 of 40
Feb 10, 2012
4. Sample Application
This section explains how to set up the CSIH functions.
4.1 Flow Charts
The flow charts of this sample program are given below. The pertinent subroutines are entered according to the
operating mode that is set up by the user.
4.1.1 Main Processing
The main processing disables maskable interrupts first. After each setup ends, the maskable interrupts and
transmit/receive status interrupts are enabled. The main loop processing repeatedly controls communication and awaits
the end of communication.
Figure 4.1 Main Processing Flowchart
START
Start program
Disable maskable interru
p
ts
Initialize system
Initialize ports
Initialize variables
Initialize CSIH3 for reception
and enable receive interrupts
Initialize CSIH0 for transmission
and enable transmit interrupts
Enable maskable interrupts
Start communication
Start reception
Await end of transmission /
reception
Clear user transmit / receive end flag
DI
SYSTEM_INITIAL
PORT_INITIAL
APPLICATION_INITIAL
RECEIVE_INITIAL
TRANSMIT_INITIAL
EI
TRANSMIT_START
RECEIVE_START
OVER ?
FLAGS_CLEAR
NO
YES