|
BV4221 |
USB to I2C converter and inspector |
Datasheet
|
£17.98 |
 |
The BV4221 is a device
for using I2C compatible equipment via USB. It provides a
terminal like interface and is primarily intended for debugging
and experimenting with I2C devices although could be used to
drive I2C devices from a PC. In addition to the above there is
an ‘inspector’ mode that allows ‘viewing’ of the I2C bus which
is useful for debugging existing applications. |
|
|
|
Quantity discounts price each 2 £16.90,
10
£14.61, 100 £11.98 |
|
This is a device that you can plug into the USB and use it to drive I2C
devices, it will also work the other way round and inspect the I2C bus for
debugging purposes. This device will enable a standard PC to control, LCD's,
Analogue to Digital Converters, Real time Clocks, Temperature Sensors, EEPROM
storage etc. In fact any I2C device on the market. This can be done
interactively or through a user program.
This site contains a full interactive set of web pages that can be
used with this device, see the VBSweb
section of this site.

The newer type is fitted with a socket and
comes with a 4 way pin head to allow for versatile connectivity. The
LED's can be seen in the picture, one indicates the state of the SCL
line the other the SDA line. If both are on, the bus is free.

The device has a USB connector at one end and the I2C interface at
the other. There are built in pull up resistors to the SDA and SCL line
and also LED indicators. The indicators are illuminated when the bus
lines are high, thus when both are illuminated the bus is free. This is
very useful for detecting 'locked up' devices.
The BV4221 presents itself to the PC as a COM port, this is useful
because it can be used with any terminal software, it will work with
Windows and Linux.

At switch on the BV4221 waits for the enter key to be pressed, it
will then select an appropriate Baud rate based on that. In the
above example BV Terminal is being used but this could be any
terminal software. The prompt by default is 0x42>, this indicates
working in hex mode with a slave device address of 0x42 (66
decimal).
As an example to write to a serial EEPROM the values 1,2 & 3 at
address 0x120:

The first command Aa0, changes the address to 0xA0. In the second
line the letters and numbers have the following meaning:
s sends a start condition
1 20 sends to the EEPROM the address where the data is
to be written, this is a 16 bit value, hence to bytes are sent.
1 2 3 are the data that is stored at the address
p is the stop condition
To read the data back:

s 1 and 20 set the memory address as before
r sends a re-start condition, telling the EEPROM that we
now wish to read it. A restart is a start condition followed by the
address plus 1 and so 0xA1 will have been sent.
g-3 this gets three bytes from the EEPROM, it will send the
appropriate NACK on the last byte to tell the EEPROM no more bytes are
required. As can be seen the bytes that were restored are retrieved.
All of the above can of course be done under program control so that
an automated system can be implemented, a temperature logger for
example. Very little knowledge of electronics is needed as all of the
functionality is within the I2C devices.
Free Software
Software is available for driving this device directly from a PC
using a browser. Here is a screen shot of just one of the pages for
driving the well known PCF8591. Other devices on the web site are:
BV5205-ADC
BV4205-ADC driving an LM35 temperature sensor (with circuits diagrams)
BV4206 - GPIO
BV4218 - LCD + Keypad IC
The software, which is very simple, is all contained within the
browser htm file and can also be used for stand alone VBS applications.
This is all explained at this page. The
whole (quite small) can be downloaded as a
zip file and run form your own PC. VBScript will even run in
applications such as Excel so it would be possible to have say a data
logger interfacing directly with the spreadsheet. The only limitation is
that because VBScript is a Microsoft product this particular software
will not work on other operating systems.
Features
- I2C up to 400kHz
- User configurable address
- Simple command set for direct interface to LCD module
- Back light output
- Contrast trimmer
- 1,2 and 4 line displays
- 31 character buffer for I2C
- 12 way crosspoint keypad interface
- 16 key keypad buffer
- Extra general purpose pin or interrupt when key available
- Operating voltage 2.0 to 5.5V
- Current <1mA @ 5V
|