<< Previous | Index | Next >>

5. More Information on RabbitFLEX BL300F Options

This chapter provides links, references and additional information about the RabbitFLEX BL300F options. All Rabbit documentation can be accessed online at rabbit.com or from the Dynamic C CD that came in the RabbitFLEX Tool Kit.

5.1 PowerCore Module Options

For more information on the core module options, see the following manuals:


5.1.1 Ethernet

For more information regarding the software necessary for Ethernet communication, see the following manuals:


5.1.2 Serial Flash

One of the benefits of having a serial flash is the ability to use the Dynamic C FAT module. The small footprint of this well-defined industry-standard file system makes it ideal for embedded systems. The Dynamic C implementation of the FAT file system has a directory structure that can be accessed with either Unix or DOS style paths. The standard directory structure allows for monitoring, logging, Web browsing, and FTP updates of files.

For more information, see:

5.2 Serial Communication

Dynamic C provides drivers for RS-232 and RS-485. For a full discussion of these drivers, see the Technical Note, TN213: "Rabbit Serial Port Software."


5.2.1 Comparison of RS-232 and RS-485

Both RS-232 and RS-485 are popular and well-established serial communication protocols that are used by many different devices. There are a number of considerations when choosing which serial protocols are right for a particular application. The following table looks at both protocols and compares these considerations.

Table 5-3. Serial Communication Parameters
Parameter RS-232 RS-485
Max number of drivers 1 32
Mode of operation Full-duplex Half-duplex
Topology End-to-end Multidrop, with node-to-node communication
Max distance 15 m 1200 m
Max slew rate 30 V/µs n/a

RS-485 was developed to overcome some of the limitations of RS-232, such as the distance between transmitter and receiver. RS-485 also has a more open topology, allowing the RabbitFLEX BL300F to be part of a multidrop network of serially connected devices.

Figure 5.1 Multidrop Network Wiring


5.3.1 Termination Resistors

You can design the RS-485 circuit to include termination resistors or not. A third option is to have selectable termination. For best performance in a multidrop network, termination resistors are enabled only on the end nodes and are disabled on intervening nodes.

At the time of this writing, more information on the termination of transmission lines can be found at:


www.bb-elec.com/tech_articles/rs422_485_app_note

5.4 Digital Outputs

There are several types of options available for digital outputs. There are sinking and sourcing drivers, as well as line drivers. No matter which digital output type you have, the circuit is activated by a call to flexDigOut() or flexDigOutGroup16().


5.4.1 Sinking and Sourcing Drivers

One approach to boost the power of DC control signals is to use a sinking output. There are two choices for sinking outputs on a RabbitFLEX BL300F: a sinking output that can sink up to 1 A and one that can sink up to 100 mA. Another advantage of a sinking output driver is that it can control large voltage--up to the rating of the transistor used. The 1 A sinking driver can control up 40 V.

A sinking output uses an NPN transistor. The transistor's emitter is connected to ground potential. When on (the control signal, called the base, is high), the output terminal, called the collector, is connected to ground.

Another type of digital output driver is the sourcing output driver. It is the complement of the sinking output and uses a PNP transistor. The emitter is connected to a positive supply. When the transistor is on (a low voltage on the control signal), the collector is connected to the positive supply.

As with the sinking driver, there are two choices for sourcing outputs on a RabbitFLEX BL300F: a sourcing ouput that can source up to 400 mA and one that can source up to 50 mA.

At first, sourcing drivers seem to make a little more sense than sinking drivers, but they are not as efficient as sinking drivers. PNP transistors typically do not have current ratings as high as their NPN counterparts. Sourcing drivers can, however, source current to devices that are connected to negative power supplies.

One way to "see" the difference between sourcing and sinking power is to expand on the water analogy that is often used to understand the different terms that describe electricity, such as voltage and current.

Using a water tower, Figure 5.2 illustrates that the transistor type used in the sourcing driver is connected to the power supply (i.e., the water in the tower), thus sourcing power for the attached load when the transistor's control line is activated. The transistor type used in a sinking driver is connected to ground (i.e., the water at ground level) thus causing current to flow in the attached load by sinking the current to ground when the transistor's control line is activated.

When selecting a driver, make sure to consider the type of load you will be driving. If driving an inductive load, such as a relay, solenoid or electric motor, select a driver that has diode protection to prevent burning out the driver transistor. See Section 5.4.3 for more on protection diodes.

Figure 5.2 Water Tower Analogy of Sinking and Sourcing Power


5.4.2 Line Drivers

Line drivers are used to increase current, thereby enhancing transmission reliability.


5.4.3 Protection Diodes

A protection diode gives a path for high voltages to follow when driving an inductive load. Just as you cannot stop a freight train instantaneously, you cannot stop current in a magnetic coil instantaneously. When the transistor is turned on, current runs through the transistor, then through the coil. The diode has no current running through it at all because it is back biased (current only runs in the direction of the diode arrow.) For a very short time immediately after the transistor turns off, current is still moving through the coil. It must go somewhere. The protection diode provides a path for that current to go around in a loop until the coil's resistance eventually stops the current (typically takes less than 5 ms). A very high voltage would develop at the transistor's collector without the protection diode, which could zap and destroy the transistor. Typical inductive loades include the magnetic coils in relays, soleniods and electric motors.

5.5 DACs

To produce an analog signal for the DAC channel outputs, the Rabbit generates precisely timed pulses using PWM (pulse width modulation). The digital signal, which is either 0 V or 5 V, is a train of pulses. This means that if the signal is taken to be usually at 0 V (or ground), there will be 5 V pulses. The voltage will be 0 V for a given time, then jump to 5 V for a given time, then back to ground for a given time, then back to 5 V, and so on. The digital signal is a value between 0 and 1024. This value is used to set the duty cycle of the PWM channel by passing it to the function pwm_set().

Figure 5.3 Duty Cycle Examples

Thus, the software only needs to vary the time the signal is at 5 V with respect to the time the signal is at 0 V to achieve any desired voltage between 0 V and 5 V.

The quality of the analog signal is determined largely by the settling time, the slew rate and the output resolution of the DAC channel.

5.6 Speaker

DAC Channel #0 can be configured as an input to a speaker. The audio hardware on the RabbitFLEX board has two sections, the filter and the amplifier. The first part, the filter, converts the high speed digital pulses that come from the Rabbit processor into a smoothly varying analog signal. It does this through low pass filtering. According to its name, low pass filtering allows low frequency signals to pass through it while blocking higher frequency signals. For a complex signal like digital pulses, this has the effect of averaging them out to produce an analog signal. In this way, the low pass filter converts a pulse width modulated (PWM) signal into a variable voltage signal. The filter is composed of resistors and capacitors arranged so that the high frequency signals are bypassed to ground through the capacitors.

After the audio signal is filtered it must be amplified in order to be powerful enough to drive a speaker. This is done with an LM386 audio amplifier IC. The signal from the filter must be amplified because it is a high impedance signal. Simply put, a high impedance signal is one that is degraded if it is used to directly power an electrical load. So instead of directly connecting the filter output to the speaker, it is connected to the amplifier input. The amplifier input senses the signal from the output and generates a matching low impedance signal that has enough power to drive the speaker effectively.

When dealing with digital to analog conversion and WAV files (a popular standard for digitized audio information) one of the most important questions is does it sound like the original analog signal that was used to create the WAV file?

The answer depends on two things: the sampling rate and the sampling precision used when creating the digital audio file. Digital audio samples are simply a sequence of values, each value representing the amplitude of an audio signal at a given point in time.

Figure 5.4 Sampling of a Sound Waveform

The sampling rate is the number of samples taken in one second. Looking at the figure above, you can see that if you connect the dots from left to right with straight lines, you lose a lot of the information represented by the curved line. By increasing the sampling rate, the closer the straight lines match the curved line, meaning less information is lost.

The sampling precision is the number of gradations possible for each sample point. Each time a sample is taken, the sampling precision determines the digital value that is assigned. For example, if the precision is 10 the software can assign a sample one of 10 discrete numbers. By increasing the sampling precision, just like with the sampling rate, you can make the sample points more closely resemble the curved line of the analog signal.

As of the date of this manual, a really good description of sampling rate and precision (among other things) can be found at:


www.howstuffworks.com/analog-digital3.htm 

5.7 ADCs

To measure the analog input signal, the ramp-compare ADC circuits uses the ramp generator on the PowerCore module. The ramp generator produces a saw-tooth signal that ramps up, then quickly falls to zero. The input capture timer starts counting when the ramping up starts. When the ramp voltage matches the analog input signal, a comparator fires, and the timer's value is recorded.

The RAMP_OUT pin is the output from the core module's ramp generator.

The calibration of the ramp is tied to an onboard 2.5 V voltage reference. The 400 Hz ramp has a linear rise time from 0 to 3.1 V of approximately 1.9 ms, and ramps down in approximately 0.45 ms. (The ramp actually starts at a slightly negative voltage of approximately -0.05 V.) The ramp output has a linearity of about 0.1%.

For more information on the ramp generator, see the PowerCore FLEX User's Manual.


RabbitFLEX << Previous | Index | Next>> www.rabbit.com