1. Hardware
  2. Features
  3. Jumper settings
  4. LED indicators
  5. Downloads
  6. Python code
  7. Lazarus example


Hardware

EasyUSB

Features

Jumper settings

Receive Data (RxD) and Clear to Send (CTS) inputs of MCP2200 chip are floating if jumpers are removed. EasyUSB board contains pull-up/pull-down  resistors for RxD and CTS lines.

rp1RxD pull-up resistor active
(default)
rp2RxD pull-down resistor active
cp1
CTS pull-down resistor active
(default)
cp2
CTS pull-up resistor active

LED indicators

EasyUSB contains 8 LEDs. 6 yellow LEDs indicate P0-P5 state. Yellow LED lights when the corresponding P0..P7 output turned high level. P6 and P7 line can be configured as RX/TX indicator. This needs inverted logic, so the corresponding green LED lights  if P6 or P7 turned low level.

Downloads


Python code

First make an "easyusb" folder in C drive and copy SimpleIO-UM.dll into this folder.  You can find this file in  MCP2200 User DLL 2013-01-28 zip file.  This code works with Python3.x 32 bit version. DOWNLOAD 32 BIT PYTHON ON 64 BIT SYSTEM ALSO!!! 32bit code will run on 64bit system. SimpleIO-UM.dll doesn't support 64 bit DLL calls, therefore it won't work with  64 bit development tools.
  1. from ctypes import *
  2. mydll=windll.LoadLibrary("C:\\easyusb\\SimpleIO-UM.dll")
  3. mydll.InitMCP2200(0x4d8,0x00df)
  4. mydll.ConfigureMCP2200(0,9600,0,0,False,False, False, False)
  5.  
  6. mydll.SetPin(1)

This code establishes connection with MCP2200 using InitMCP2200 function. It's two arguments are VendorID and ProductID provided by Microchip. Next step is configuring IO lines, set up baudrate, etc. SetPin(1) function sets P1 high level. You can find more information in 2.3 chapter of 
MCP2200 Data Sheet
. Most important fuctions are InitMCP2200, ConfigureMCP2200, SetPin, ClearPin, ReadPortValue, WritePort(portValue), ReadPinValue(pinnumber).

Led blinking example code

  1. from ctypes import *
  2. from time import sleep
  3.  
  4. mydll=windll.LoadLibrary ("C:\\easyusb\\SimpleIO-UM.dll")
  5. mydll.InitMCP2200(0x4d8,0x00df)
  6. mydll.ConfigureMCP2200(0,9600,0,0,False,False, False, False)
  7.  
  8. while True:
  9.     mydll.SetPin(2)
  10.     sleep(0.5)
  11.     mydll.ClearPin(2)
  12.     sleep(0.5)

Lazarus example

lazarus

A more complex example written in Lazarus (Delphi like Pascal code). Download here.
This code works with Lazarus 32 bit version. DOWNLOAD 32 BIT LAZARUS ON 64 BIT SYSTEM ALSO!!! 32bit code will run on 64bit system. SimpleIO-UM.dll doesn't support 64 bit DLL calls, therefore it won't work with  64 bit development tools.