- on Microcontrollers
- Published in issue 1/2002 on page 0
USB UART (2)
setting the port currents
Although the Elektor Electronics USB interface described in the September 2000 issue allows the port current to be set for only one port, the port IC allows the current to be set for each pin.The module USBuart.bas provides the subroutine Sub WrIsink Pin, Wert. The parameter Pin may have a value of 0 through 7 for port pins P00 through P07 or 8 through 11 for port pins P10 through P13. Listing 1 shows a simple program for setting the sink currents of all four Port 1 outputs, while Figure 1 shows the associated screen display.The microcontroller contains a simple 4-bit DAC for each port pin, consisting of four weighted current sources. We can ask ourselves if we can’t use this for something more worthwhile than just controlling the brightness of a few LEDs.