| データシートサーチシステム |
|
MCP9804-E/MS データシート(PDF) 44 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
MCP9804-E/MS データシート(HTML) 44 Page - Microchip Technology |
|
44 / 54 page ![]() MCP9804 DS22203A-page 44 © 2009 Microchip Technology Inc. /******************************************************************** FileName: I2C.c Dependencies: I2C.h Processor:PIC18 Microcontrollers Complier: Microchip C18 (for PIC18) or C30 (for PIC24) Company:Microchip Technology, Inc. Software License Agreement: The software supplied herewith by Microchip Technology Incorporated (the “Company”) for its PIC® Microcontroller is intended and supplied to you, the Company’s customer, for use solely and exclusively on Microchip PIC Microcontroller products. The software is owned by the Company and/or its supplier, and is protected under applicable copyright laws. All rights are reserved. Any use in violation of the foregoing restrictions may subject the user to criminal sanctions under applicable laws, as well as to civil liability for the breach of the terms and conditions of this license. THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. **************************************************************/ #include"p18f2550.h" // This code is developed for PIC18F2550 //It can be modified to be used with any PICmicro with MSSP module #include "I2C.h" /******************************************************************** * Function Name: OpenI2C1 * * Return Value: void * * Parameters: SSP1 peripheral setup bytes * * Description: This function sets up the SSP1 module on a * * PIC18CXXX device for use with a Microchip I2C * * EEPROM device or I2C bus device. * ********************************************************************/ void OpenI2C(unsigned char sync_mode, unsigned char slew) { SSPSTAT &= 0x3F; // power on state SSPCON1 = 0x00; // power on state SSPCON2 = 0x00; // power on state SSPCON1 |= sync_mode; // select serial mode SSPSTAT |= slew; // slew rate on/off SSPCON1bits.SSPEN = 1; // enable synchronous serial port } /******************************************************************** * Function Name: I2CStart * Return Value: void * Parameters: void * Description: * ********************************************************************/ void I2CStart(void) { PIR1bits.SSPIF = 0;//Clear Interrupt SSPCON2bits.SEN=1; while(!PIR1bits.SSPIF);//Wait for data received Interrupt PIR1bits.SSPIF = 0;//Clear Interrupt } |
|
リンク URL |
| ALLDATASHEETはお客様のビジネスに役立ちますか? [ DONATE ] |
Alldatasheetは | 広告 | お問い合わせ | プライバシーポリシー | データシートへのリンク | リンク交換 | メーカーリスト All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |