Subscribe
Showing posts with label USB. Show all posts
Showing posts with label USB. Show all posts

89LPC9xx USB Programming

Posted by Circuit Labs on Sunday, November 23, 2008

Back in November 2003 you could already read about a small development system for the (then) new series of controllers from the 8051-compatible 89LPC9xx-family. A nice feature of the current 89LPC9xx-series is that these chips can remain in the circuit while (re-)programming. All that’s required for this programming is an RS232 port. But because many modern computers do not have an RS232 connection any more, we propose here a USB version. For this we use a well-known USB/RS232-converter chip, the FT232R.

The 89LPC9xx series can be placed in programming mode in two different ways: by transmitting a ‘break’ over the serial port or by providing three defined reset pulses immediately after power-on. We use the latter method, because this is a hardware solution. This is because the ‘break’ has to be sensed by software. In plain language: this method only works with a well-behaved program. And this is obviously not always the case in a development environment!

Click to enlarge...

When you also look at the schematic from 2003, you will see that very little has changed. Really the only difference is that the RS232 interface chip has been replaced with the FT232R. As you will know, the USB-interface is terribly slow when the handshake lines such as DTR and RTS are used. Fortunately that is not the case here, since DTR and RTS are used just once at the beginning and end of the programming cycle. The actual programming is done by transmitting commands and data across the serial port.

A few remarks:
To be able to program you will have to change a jumper each time. On the one hand this is a little tedious, but on the other hand it gives a little bit of security. During software development a double pole change-over switch does wonders! Note that the processor is placed in programming mode by three reset pulses after power-on. If the power supply voltage does not drop sufficiently beforehand (<2.7 V), then the processor will not be placed in power-up mode by the brownout circuit and therefore cannot be placed in programming mode either. That is why a resistor of 4k7 has been added to drop the power supply voltage faster and lower. Check the inputs in your application. If these are powered from another voltage then the processor will be powered from its inputs via the protection diodes and programming will not work then!

It is possible (but not necessary) to power the circuit through a low-drop regulator from the USB-connection. You can also omit L1, but it is better to put a few turns of wire through a ferrite bead. The pin numbering shown is for the SSOP-28 package.

Author: _

(Elektor Electronics Magazine – 2006)



* Download this article.
--> Read more...

USB Switch for Printers

Posted by Circuit Labs on Wednesday, November 19, 2008

This circuit switches a printer’s USB connection from a PC to a laptop. What was needed was a method of allowing a laptop to use the printer occasionally while at all other times the printer would be connected to the PC. Instead of unplugging the printer from the PC and then into the laptop, the circuit switches the USB connection automatically. K1 and K2 are standard type-B USB sockets, while K3 is a USB type-A socket. The USB lead from the laptop plugs into K2 while the PC’s USB lead plugs into K1. A USB cable from K3 connects the printer to this circuit. The cable from the PC is always plugged in while the cable from the laptop is only connected whenever this device needs to print.060103

In normal operation the laptop is not connected to K2, so the USB signal to the printer comes from the PC via K1, the normally closed contacts of relay Re1, through to K3 and from there to the printer. Whenever the laptop is connected up, the presence of the 5- volt power signal on its USB port causes Re1 to switch over to the printer’s connection to K2 and the laptop. Unplugging the laptop returns control of the printer back to there PC.

The circuit was tested on a USB 1.1 compliant printer and a PC and laptop that had USB-2.0 highspeed ports. The PCB traces for D+ and D– should be kept as short as possible and ideally should be the same length. The relay should be a low-power type (5 V at <100 mA coil current) with two changeover (c/o) contacts.

Switch S1 is only required in situations where the two computers you want to select between are permanently present and connected up to the circuit. The switch then selects the computer having access to the printer.

Author: Liam Maskey

 (Elektor Electronics Magazine – 07/2006)



Download this article (direct link #060103-uk.pdf)

--> Read more...

Subscribe to: Posts (Atom)