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> CompilerThese declares, as is the case with all the DECLARES, may only beissued once in any single program, as they setup the I 2 C library codeat design time.You 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 - 0Slows the bus speed when using an oscillator higher than 4MHz.The standard speed for the I 2 C bus is 100KHz. Some devices use ahigher bus speed of 400KHz. If you use an 8MHz or higher oscillator,the bus speed may exceed the devices specs, which will result in intermittentreads, or in some cases, no reads at all. Therefore, use thisDECLARE if you are not sure of the device’s spec. The datasheet forthe device used will inform you of its bus speed.Notes :When the BUSIN 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 of 4.7Kto 10K Ohms will suffice.See also :BUSOUT for suitable circuit, DECLARE29Copyright Crownhill 2001

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

Saved successfully!

Ooh no, something went wrong!