Download 78K0/Kx2-L Sample Program (Serial Interface IICA)
Transcript
Application Note 78K0/Kx2-L Sample Program (Serial Interface IICA) Slave Communication This document describes an operation overview of the sample program and how to use it, as well as how to set up and use serial interface IICA. In the sample program, 16 bytes of data are transmitted and received via the I2C bus in slave operation. Target devices 78K0/KY2-L microcontroller 78K0/KA2-L microcontroller 78K0/KB2-L microcontroller 78K0/KC2-L microcontroller Document No. U19691EJ1V0AN00 (1st edition) Date Published September 2009 N 2009 Printed in Japan CONTENTS CHAPTER 1 OVERVIEW...................................................................... 3 1.1 Primary Initial Settings................................................................ 4 1.2 Processing After Main Loop ....................................................... 4 CHAPTER 2 CIRCUIT DIAGRAM........................................................ 5 2.1 Circuit Diagram ........................................................................... 5 2.2 Used Device Other than Microcontroller..................................... 6 CHAPTER 3 SOFTWARE..................................................................... 7 3.1 Included Files ............................................................................. 7 3.2 Internal Peripheral Functions to Be Used................................... 7 3.3 Initial Settings and Operation Overview ..................................... 8 3.4 Flow Charts ................................................................................ 9 CHAPTER 4 SETTING METHODS ................................................... 13 4.1 Setting up Serial Interface IICA ................................................ 13 4.2 Software Coding Example ........................................................ 25 CHAPTER 5 RELATED DOCUMENTS ............................................. 29 APPENDIX A PROGRAM LIST ......................................................... 30 APPENDIX B USING 78K0/KC2-L 44-PIN PRODUCTS ................. 59 APPENDIX C REVISION HISTORY .................................................. 60