11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PICBASIC</strong> <strong>PLUS</strong> CompilerYou may imagine that it’s limiting having a fixed interface, but youmust remember that several different devices may be attached to asingle bus, each having a unique slave address. Which means thereis no need to use up more than two pins on the PIC.DECLARE SLOW_BUS ON - OFF or 1 - 0.Slows the bus speed when using an oscillator higher than 4MHz.The standard speed for the I 2 C bus is 100KHz. However, some devicesuse a higher bus speed of 400KHz. If you use an 8MHz orhigher oscillator, the bus speed may exceed the devices specs, whichwill result in intermittent writes, or in some cases, no writes at all.Therefore, use this DECLARE if you are not sure of the device’s spec.The datasheet for the device used will inform you of its bus speed.Notes :When the BUSOUT command is used, the appropriate SDA and SCLPort and Pin are automatically setup for ins and outs.Because the I 2 C protocol calls for an open-collector interface, pull-upresistors are required on both the SDA and SCL lines. Values from4.7KΩ to 10KΩ will usually suffice.See also :BUSIN+5 Volts0VC110uFC20.1uFR14.7k4MHzCrystalC322pF41615C422pF14VDDRB7MCLR RB6RB5RB4RB3OSC1 RB2RB1RB0PIC16F84RA4OSC2 RA3RA2RA1VSS RA051312111098763211817R2-R34.7k658VCC24C32SCLSDA VSS4WPA0A1A27123A typical use for the I 2 C commands is for interfacing with serialeeproms. The diagram shows the connections to the I 2 C bus of a24C32 serial eeprom.32Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!