Home ] Up ]
 
  BV4205 ADC  
 

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:

   
 
     
  I2C System Commands  
  The next section is common to all I2C BV devices and can be used to interrogate the EEPROM and change the address etc. You will see that address 0 of the EEPROM is the device address.
Common BV, I2C System Functions
<< set device address Firmware version >>
From #Bytes Results
When writing separate hex with comma, e.g. 0a,9,fd,0,3
 From Data
The reset button will just reset but the factory button installs defaults ** Note the address is set back to 0x42 as well.
<< new address EVEN numbers only
 
     

  BV4205 Analogue to Digital Converter  
 

The BV4205 is an I2C two wire compatible integrated circuit with a 10 channel 10 bit A to D converter. The IC works independently of the microcontroller and can acquire analogue signals continuously until required.

Pin 2 should be left unconnected for normal operation. Pins 11 and 13 are connected to the BV$221 for communication purposes. There is a full description of how to use this device in the datasheet. There is also an example of using this with an LM35 temperature sensor.

Show here is a typical set up using the BV221 to drive the A to D chip. It is now just a matter of connecting a few external components to the ADC and reading the results from the form below.

 

 
 
     
  ADC Form  
 
BV4205 ADC IC 
Start Auto Scan  Vref from pin 18 Voltage >> 0-2
Channel 0        Channel 1        Channel 2  
Channel 3        Channel 4        Channel 5  
Channel 6        Channel 7        Channel 8  
Channel 9  

Channel <<     >> Voltage >> Using Reference above

 
     

The BV4205 basically has two modes of operation, this is fully covered in the datasheet, but briefly they are the standard mode whereby a channel is selected, a conversion command is given and the results are fetched. This is done at the bottom of the pink form with the buttons, 'Acquire' and 'convert'. Acquire simply selects the channel that has been placed in the channel text box. For convenience there is a script that can convert the ADC value to an actual voltage using the voltage in the voltage text box at the top of the form.

The second method is to continuously scan all 10 channels, this is done inside the chip. To activate this feature select the 'Start Auto Scan' check box, this will send the correct command to the device. By default the BV4205 uses VCC as a reference but this can be overridden by selecting the 'Vref' check box. The voltage is used simply in the calculation at the bottom of the form, it does not set the reference, this is done externally.