SW006010 Microchip Technology, SW006010 Datasheet - Page 83

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.
3.4.2
The following are simple code examples illustrating a software I
communicating with a Microchip 24LC01B I
provided no error checking utilizing the value returned from a function is implemented.
The port pins used are defined in the
requirements.
#include <p17cxx.h>
#include <swi2c16.h>
#include <delays.h>
extern far ram union i2cbus_state
{
} BUS_STATUS;
// FUNCTION Prototype
void main(void);
void byte_write(void);
void page_write(void);
void current_address(void);
void random_read(void);
void sequential_read(void);
void ack_poll(void);
unsigned char warr[] = {8,7,6,5,4,3,2,1,0};
unsigned char rarr[15];
unsigned char far *rdptr = rarr;
unsigned char far *wrptr = warr;
unsigned char var;
#define W_CS
//**************************************************
#pragma code _main=0x100
void main(void)
{
}
void byte_write(void)
{
struct
{
};
unsigned char dummy;
byte_write();
ack_poll();
page_write();
ack_poll();
Nop();
sequential_read();
Nop();
while (1);
SWStartI2C();
var = SWPutcI2C(0xA0); // control byte
swAckI2C();
var = SWPutcI2C(0x10); // word address
swAckI2C();
var = SWPutcI2C(0x66); // data
SWAckI2C();
SWStopI2C();
unsigned busy :1; // bus state is busy
unsigned clk
unsigned ack
unsigned
Example of Use
PORTA.2
:1; // clock timeout or failure
:1; // acknowledge error or not ACK
:5; // bit padding
Software Peripheral Library
swi2c16.h
2
C EE Memory Device. In all the examples
file and must be set per application
2
C implementation
apRNOVS^-page 79

Related parts for SW006010