MCP9808 MICROCHIP [Microchip Technology], MCP9808 Datasheet - Page 43

no-image

MCP9808

Manufacturer Part Number
MCP9808
Description
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
MCP9808-E/MS
Manufacturer:
MICROCHIP
Quantity:
1 690
Part Number:
MCP9808-E/MS
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
MCP9808T-E/MC
Manufacturer:
MICROCHIP
Quantity:
12 000
Part Number:
MCP9808T-E/MS
Manufacturer:
MICROCHIP
Quantity:
12 000
APPENDIX A:
/********************************************************************
#include <p18cxxx.h> // This code is developed for PIC18F2550
//It can be modified to be used with any PICmicro with MSSP module
/** PRIVATE PROTOTYPES *********************************************/
void i2c_init(void);
void i2c_start(void);
void i2c_repStart(void);
void i2c_stop(void);
unsigned char i2c_write( unsigned char i2cWriteData );
unsigned char i2c_read( unsigned char ack );
/********************************************************************
*
*
*
*
*
********************************************************************/
void i2c_init(void) {
}
© 2011 Microchip Technology Inc.
The software supplied herewith by Microchip Technology Incorporated (the “Company”) is intended and supplied to you, the
Company’s customer, for use solely and exclusively with products manufactured by the Company.
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 STATU-
TORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU-
LAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
FileName:
Processor:
Complier:
Company:
Function Name:
Return Value:
Parameters:
Description:
TRISBbits.TRISB0 = 1;
TRISBbits.TRISB1 = 1;
SSPCON1 = 0x28;
SSPCON2 = 0x00;
SSPSTAT = 0x80;
SSPADD = 19;
PIR1bits.SSPIF = 0;
PIR2bits.BCLIF = 0;
SSPCON2bits.SEN = 0;
PIC18 Microcontrollers
Microchip C18 (for PIC18) or C30 (for PIC24)
Microchip Technology, Inc.
I2C.c
SOURCE CODE
i2c_init
void
Enable SSP
This function sets up the SSP1 module on a
PIC18CXXX device for use with a Microchip I2C
Software License Agreement
// Digital Output (make it input only when reading data)
// Digital Output
// enable I2C Master mode
// clear control bits
// disable slew rate control; disable SMBus
// set baud rate to 100 kHz (Fosc = 48 MHz)
// force idle condition
MCP9808
DS25095A-page 45

Related parts for MCP9808