Published:2011/8/1 21:13:00 Author:Phyllis From:SeekIC
By Jim Spence
USB interface
The USB interface shown in Figure 2 uses a chip from Future Technology Devices Intl. Ltd. (FTDI) and the circuit follows their data sheet. The FT232BM is designed as a quasi-replacement RS232 interface and when installing the device drivers, it becomes a COM port on the PC. Drivers for other operating systems are available. The chip and associated software drivers remove any hassle from building a USB interface.
There are only a few aspects of this circuit worthy of attention. The first is the N channel MOSFET that supplies power to pin 8 of K2 when the PWREN signal is low. It is set up this way so that external devices can be powered from the USB bus when the FT232BM is initiated. The initiation process is called enumeration. The other part of the circuit is IC2. This part is optional and is only required if you need to use the special features of the chip, USB 2.0 for example, or are using two chips in the same system. The circuit will work perfectly well without it.
Before going any further it is helpful to know something about the USB interface. The interface is incredibly useful in that not only does it provide a high-speed interface but power as well. When first plugging in the device it must draw no more than 100 mA until the device is enumerated. Once enumerated the bus is capable of supplying up to 500 mA. In suspend mode this reduces to 500 /JA. All USB devices have a unique, registered ID. The FT232BM has a built in, default ID. For commercial use the ID must be registered. Also if you intend to use more than one device on the same system then each device must have a unique product ID. It is possible to set all of this up by fitting the EEPROMIC2.
Once enumeration has taken place, which is all taken care of by the FT232BM chip, the PWREN line is taken low. This is passed on to pin 7 of K2 so that it can be monitored by the microcontroller if necessary. It also activates Tl which in turn allows 500 mA to be drawn from the USB bus via pin 8 of K2.
There are two main types of socket: ’A’ and ’B’. The ’A’ socket is a power provider and is the type fitted to the PC. The ’B’ type is a power user and to our knowledge comes in about three different shapes. The one used on the PCB is the most common although smaller ones can be obtained with difficulty, these are usually found on cameras and the like.
The FT232BM requires a device driver, even on an XP system. All the device drivers, software and documentation required for the device can be obtained from the FTDI website. The driver needed is the Virtual COM Port (VCP). This will enable you to use the device as if it were a COM port.
The EEPROM device, if fitted, can be programmed using the D2XX drivers and one of the many software utilities provided at the site. Note the drivers will no co-exist, you need to uninstall one to use the other.
Good old RS232
This is for those of you who do not fancy USB. The RS232 interface circuit diagram appears in Figure 3. As RS232 port is not capable of enough supplying power it is necessary to incorporate a simple 5 V supply into the design. Bridge rectifier Bl may strike you as unusual but is well worth the extra cost, not only can you use an AC output power supply but also it does not matter which way round the polarity is on a DC power supply — just plug it in and it works.
Power from the supply is taken to pin 8 on K2 to indicate to the main board that power is available. Pin 7 is permanently at ground indicating to the main board that power is available. The circuit formed by Rl, R2 and Dl limits the voltage on the RTS Line and make it suitable for feeding into ICl on the main board. All of the I/O lines are used on ICl in order to facilitate the in-circuit programming. Only TXD and RXD are required if the in-circuit programming is not required.
Some of the functionality of the USB board is not available to the RS232 interface, so pins 6 and 9 of K2 are left unconnected.
Construction & test: MCU and RS232...
If you look at the PCB artwork shown in Figure 4, you’ll notice that the MCU, USB and RS232 sections are supplied as one board, order code 030448-1 from our Readers Services.
Depending on the connectivity you have in mind for the Swiss Army Knife you will have to populate the USB or the RS232. Sure, you can build both sections but do remember you can’t use them at the same time.
The MCU and RS232 sections are nothing special when it comes to building them — simply work along the lines indicated by the parts list and the component overlay. Sockets are of course recommended for the ICs. The 14-way connector can be cut from a larger one if required. Voltage regulator IC2 does not require a heat-sink.
Before inserting the ICs into their sockets, connect the MCU board to a 5-V supply and power up. Check with a meter that 5 volts appears at the correct polarity across pins 20 and 40 for ICl and 10 and 20 for IC2. If all is well disconnect the power, insert the ICs and re-connect the power. If you have a logic probe or oscilloscope, monitor pin 2 on K2 (pin 11 on ICl). Press reset and after 1 or 2 seconds the sign-on signal should be seen. This will be a short burst of pulses at 9600 baud.
It goes without saying that IC1 should be pre-programmed with TCB (Tiny Control BASIC) for the above to work. There is not much else you can do without the other two boards; the MCU circuit is so simple that just about the only thing that can go wrong is the soldering and component location (is everything in its correct place and the right way round).
Reprinted Url Of This Article: http://www.seekic.com/blog/project_solutions/2011/08/01/Swiss_Army__(2).html
Print this Page | Comments | Reading(465)
Author:Ecco Reading(32821)
Author:Ecco Reading(3526)
Author:Ecco Reading(3246)
Author:Ecco Reading(3801)
Author:Ecco Reading(5331)
Author:Ecco Reading(3315)
Author:Ecco Reading(3462)
Author:Ecco Reading(3604)
Author:Ecco Reading(4009)
Author:Ecco Reading(3807)
Author:Ecco Reading(3748)
Author:Ecco Reading(3780)
Author:Ecco Reading(6094)
Author:Ecco Reading(3764)
Author:Ecco Reading(4579)