SW006010 Microchip Technology, SW006010 Datasheet - Page 33

no-image

SW006010

Manufacturer Part Number
SW006010
Description
MPLAB 17C SOFTWARE
Manufacturer
Microchip Technology
Datasheets

Specifications of SW006010

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC17C
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
MPLAB®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
 2002 Microchip Technology Inc.
2.5.2
The following are simple code examples illustrating the SSP module configured for I
master communication. The routines illustrate I
24LC01B I
utilizing the function return value is implemented.
The basic I
StartI2C, StopI2C, AckI2C, NotAckI2C, RestartI2C, putcI2C, getcI2C, putsI2C,
getsI2C, etc., are utilized within the specialized EE I
EESequentialRead or EEPageWrite.
#include "p17cxx.h"
#include "i2c16.h"
// FUNCTION Prototype
void main(void);
// POINTERS and ARRAYS
unsigned char arraywr[] = {1,2,3,4,5,6,7,8,0};
//24LC01B page write
// unsigned char arraywr[] = {1,2,3,4,5,6,7,8,9,10,
//
//24LC04B page write
unsigned char far *wrptr = arraywr;
unsigned char arrayrd[80];
unsigned char far *rdptr = arrayrd;
unsigned char temp;
//***************************************************
#pragma code _main=0x100
void main(void)
{
}
OpenI2C(MASTER, SLEW_ON); //initialize I2C module
SSPADD = 9;
temp = 0;
while(1)
{
}
temp = EEByteWrite(0xA0, 0x30, 0xA5);
temp = EEAckPolling(0xA0);
temp = EECurrentAddRead(0xA1);
temp = EEPageWrite(0xA0, 0x70, wrptr);
temp = EEAckPolling(0xA0);
temp = EESequentialRead(0xA0, 0x70, rdptr, 15);
temp = EERandomRead(0xA0,0x30);
Example of Use
2
2
C EE Memory Device. In all the examples provided no error checking
C routines for the hardware I
Hardware Peripheral Library
//400Khz Baud clock(9) @16 MHz
//100khz Baud clock(39) @16 MHz
11,12,13,14,15,16,0};
2
C module of the PIC17C756 such as
2
C communications with a Microchip
2
C routines such as
apRNOVS^-page 29
2
C

Related parts for SW006010