General Overview
|
Many modern computer mainboards
or laptops don't have legacy-ports (RS232- and parallel port) anymore.
Consequently the hobbyist has to switch over to the USB-port, if he
wants to connect self made hardware with a computer. On a different webpage I
described how to develop a USB-device, but not everybody likes to spend
a lot of time in understanding the details of the USB-interface. It is
much more convenient to use a ready-made USB-solution and to put this
black-box into the own project, to solve all USB-problems. Such a solution exists: the IO-warrior-chips. They are available for a fair price and simplify the development of USB-devices. But they have some weaknesses too. Because of this, I made my own universal USB-interface-chip, based on a microchip PIC18F2455 microcontroller. This chip meets my specs and I call it USB4all. It is available in two "flavors":
|
IO-Warrior |
USB4all-MCD |
USB4all-CDC |
|
Pros: |
some
versions
don't
need a crystal, bus-powered up to 500mA, development environment, no driver necessary, |
firmware
updates
via
USB (boot loader) possible, fast USB-interface, analog inputs (10- or 12-bit-ADC), PWM-outputs (semi analog), output for stepper motor, frequency counter, internal EEPROM, RC-servo interface, ... |
firmware
updates
via
USB (boot loader) possible, analog inputs (10- or 12-bit-ADC), PWM-outputs (semi analog), output for stepper motor, frequency counter, internal EEPROM, RC-servo interface, no driver necessary, |
Disadvantages |
no
analog interfaces, control commands with low comfort, |
some
external
parts
necessary, special software interface, no development environment, bus-powered up to 100mA, |
some
external
parts
necessary, bus-powered up to 100mA, |
PC
sends
to
USB4all |
Meaning | USB4all answers |
0x55 - 0x01 - 0x00 | initiate LCD with default configuration: 2-lines x 16-symbols | 16 dummy-bytes |
0x55 - 0x02 -'A' | send 'A' | 16 dummy-bytes |
PC sends to USB4all | Meaning | USB4all answers |
0x55 - 0x01 - 0x00 |
initiate LCD with default configuration: 2-lines x 16-symbols | 16 dummy-bytes |
0x55 - 0x02 - 0x0A - 'Hallo Welt' | send 'Hallo Welt' | 16 dummy-bytes |
PC
sends
to
USB4all |
Meaning | USB4all answers |
0x51 - 0x01 - 0x01 - 0x00 |
initiate the ADC, select analog
input AN0 by default |
16 dummy-bytes |
0x51 - 0x03 | read the voltage level |
0x51 - 0x03 - low - high |
PC
sends
to
USB4all |
Meaning | USB4all answers |
0x54 - 0x01 - 0x00 - 0x00 |
initiate the I2C-bus | 16 dummy-bytes |
0x54 - 0x05 - 0x48 - 0x02 |
read the temperature |
0x00 - 0x05 - 0x48 - 0x02 -
integer-degree - fractional degree |
PC
sends
to
USB4all |
Meaning | USB4all answers |
0x57 - 0x01 - 0x00 |
initiate PWM1 at 47 kHz, 8 Bit resolution (default) | 16 dummy-bytes |
0x57 - 0x02 - 0x80 - 0x00 |
set duty cycle to 50 % |
16 dummy-bytes |
PC
sends
to
USB4all |
Meaning | USB4all answers |
0x5D - 0x01 | initiate the 1st stepper motor interface | 16 dummy-bytes |
0x5D - 0x02 - 0x32- 0x00- 0x06- 0x00 | immediately turn CW 50
half-steps with a step-rate of 1000 Hz |
16 dummy-bytes |