Recent Changes - Search:

Introduction to Microcontroller Programming

About PICmicro Chips

Clocking Your PICmicro Devices


Flowcode Step By Step

PICmicro Projects


Outputting Data

The PICmicro is a digital device - we have said that several times already! It outputs a digital signal. In most cases, we use this to turn something on and off - '0' = 'off' and '1' = '0n', for example.

Suppose that we set up port B as the output port, or let Flowcode do it for us. There are eight pins on port B, so we can switch eight devices on and off.

It is important to plan how we connect these devices, as otherwise they can work the opposite way round. The diagram shows eight LED's connected to port B. Notice that the four red LED's are connected between the positive supply rail and the port B pins. In this case the PICmicro is 'sinking' current. The green LED's are connected between the pins and the 0V rail. In this case the PICmicro is 'sourcing' current. Each red LED lights up when its pin is at a low voltage, outputting '0' in other words. Each green LED lights when its pin is at a high voltage, outputting a '1'.

(There are limits as to how much current the ports can control. Typically, one output pin can manage up to 25mA. This is enough to drive LED's and buzzers directly, but higher-powered devices will need additional circuitry to interface with the PICmicro. These matters are dealt with later. However, the maximum current for the whole port is around 100mA, so not all pins can output 25mA at the same time.)

As you will see shortly Flowcode has a simulation mode that allows you to attach LEDs to show the status of the pins on the microcontroller when they are used as outputs. The LED simulation function inside Flowcode assumes that current is sourced from the PICmicro device - like the green LEDs in the diagram above.

Print - Search - Login

Page last modified on August 19, 2011, at 11:45 AM