Home ] Up ]
 
  PCF8591  
 

Contained within this html page are scripts that will work in conjunction with the VB4221. The BV4221 is a USB to I2C converter so that by connecting the BV4221 to the PC and also to one or more I2C devices, it is possible to control them from this browser document.

There are several documents in the series all of which concentrate on one particular I2C device, the first green and second blue forms are for communicating with the BV4221 and any form or text that follows is for the particular device in question. This text uses BV scripts and so depending on how the browser is configured there may be security warnings. Feel free to view the scripts and use as you like in your own applications.

Because VBScript is used then an IE (Microsoft) compatible browser is required. VBscript can also be made to run stand alone and within Microsoft applications such as Excel and Word. The script in this file should run with little modification.

 
     
  Open COM Port  
  The 'Open Port' button opens the COM port and checks the BV4221 is connected, it will not show an error if the wrong com port is chosen but will indicate if the correct port has been chosen and the BV4221 is connected.
Open COM Port
Com Port Number 1-5:      Port Settings:

   
 
     

  PCF8591  
  The PCF8501 is a simple but very popular I2C Analogue to Digital and Digital to Analogue converter.  The form used in this script is very basic and can be expended if required.

The four output connections of the BV4221 go to VSS,VDD,SCL and SDA of the 8591. The base address of this device is 0x90, that's with A0-A2 all connected to VSS (ground). If they were all connected to VSS then the address would be 0x9F.

The schematic is for experimental / demonstration purposes only. In practice attention needs to be paid to the Vref input to reduce the noise as much as possible. A to D circuits tend to be sensitive devices and it is easy to get poor results.

 
     
  BV4218 From  
 

The 8591 can perform more complex actions than the functionality built into the form below, but this serves to demonstrate how to communicate with the 8591 using the BV4221. The scripts can be easily copied and modified. Set the radio button to either receive AD information or send it. When receiving information, set the channel to receive from.

.

Address
A to D Channel 0-3  >>
D to A Value