NOVA electronics Inc. MCX514 -
159
-
159
-
4.2.5 Control Example
The following three examples show the flow of controlling the IC using I2C serial bus. The user can download sample programs
for controlling each type of CPU including these three examples, from our web site:
(1) Write command
(2) Write data
(3) Read data
(1) Write command
To write a command, the user needs to write an execution axis and command to WR0 register. At this time, if the low byte of
WR0L is written, a command will be executed immediately. So the user needs to specify the axis before issuing a command. As
shown below, specify an axis at
①
, and then write a command at
②
.
①
Write an axis assignment to WR0H.
②
Write a command to WR0L
Generate start condition
Generate stop condition
Write axis assignment (WR0H)
Write slave address
Generate start condition
Generate stop condition
Write command (WR0L)
Write slave address