This preview shows page 1. Sign up to view the full content.
Unformatted text preview: LabVIEW Diagram Panel for the Serial Transmitter Simulation The first bit to be output (Start) is initialized to the Space state (0), a Boolean False. The following eight elements are the data byte in sequence, least significant bit to most significant bit. The last element on the shift register (Stop bit) is initialized to a Mark state (1), a Boolean True. The VI, when called, executes the loop 10 times. Each loop outputs one serial bit. A wait structure simulates the "basic timing period" or 1/Baud Rate. As the data is shifted out the serial line, the shift register is filled with ones. This ensures the output will be in the Mark state at the end of transmission, after 10 cycles. Figure 11-7. Transmitter Buffer After Data Byte Has Been Sent to the Port It becomes easier to view the serial waveforms by writing the serial output to an oscilloscope or a strip chart recorder. In the second VI, Serial1.vi, the serial output is converted into a numeric and then written to a LabVIEW National Instruments Corporation 11-3 Fundamentals of Digital Electronics Lab 11 Serial Communications chart. By selecting the correct set of chart symbols and interpolation features, the trace will resemble that of an oscilloscope trace, and you can view the transmitted serial waveforms at low baud rates. The following traces show the waveforms for the numbers $00 (00000000), $55 (01010101), and $FF (11111111). Figure 11-8. Serial Waveforms for Repetitive Transmission of the Same Data Byte Note the middle case, $55, generates a square wave on the serial output pin. Once built, the parallel-to-serial converter can be saved as a subVI and used in other programs. In general, this VI will have eight binary inputs for the input parallel data byte, a binary output for the serial bit stream, and a numeric array for the logic trace. Voltage to Serial Transmitter
In the first application, a numeric input simulates an analog input. The numeric value has been conditioned to be in the range 0-255. RampADC.vi, discussed in Lab 9, converts the analog signal into an 8-bit binary number, which in turn is passed on to the parallel-to-serial converter. To observe the signal, the serial waveform is passed into an array and presented on the front panel as a logic trace. Fundamentals of Digital Electronics 11-4 National Instruments Corporation Lab 11 Serial Communications Figure 11-9. Serial Transmitter Exploits LabVIEW SubVIs Load the VI named V->Serial.vi and observe the serial waveforms. Each number from 0 to 255 will yield a different waveform. Try the data bytes $00, $55, and $FF to verify the waveforms shown in Figure 11-8. In the second example, a two-character hexadecimal-encoded ASCII string is input into a subVI named Hex->Numeric.vi, which converts the hexadecimal characters into a number. Figure 11-10. Waveform Generator with Hexadecimal Input The hexadecimal string value is converted into a numeric value using a LabVIEW string function called Format and Strip. The numeric value is then passed on to the previous VI, V->Serial.vi, and displayed. Recall that (0101 0101) in Serial1.vi generated a square wave. In HEX->Serial.vi, $55 also generates the square wave. LabVIEW Challenge
Can you generalize this input to be any 7-bit ASCII character? The eighth bit could be a parity bit, even or odd. Lab 11 Library VIs (Listed in the Order Presented) Serial.vi (demonstration of a serial transmitter) Serial1.vi (Serial.vi with a logic trace output) V->Serial.vi (LabVIEW simulation of a serial transmitter) National Instruments Corporation 11-5 Fundamentals of Digital Electronics Lab 11 Serial Communications Hex->Serial.vi (LabVIEW simulation of a serial transmitter with hex input) RampADC.vi (subVI 8-bit ADC) Binary Counter.vi (subVI 8-bit binary counter) DAC.vi (subVI 8-bit DAC) FlipFlop.vi (subVI T flip-flop) Hex->Numeric.vi (subVI that converts hexadecimal number into a numeric) Serial2.vi (subVI Serial1.vi with numeric array output) Fundamentals of Digital Electronics 11-6 National Instruments Corporation Lab 12 Central Processing Unit
The heart of any computer is the central processing unit (CPU). The CPU communicates with the memory over a bidirectional data bus. In memory reside program instructions, data constants, and variables, all placed in an ordered sequence. The CPU reaches out to this sequence by controlling and manipulating the address bus. Special memory locations called input/output (I/O) ports pass binary information to or from the real world in the form of parallel or serial data bytes. The system clock oversees the whole network of gates, latches, and registers, ensuring that all bits arrive on time at the right place and that no data trains collide. Of the four parts of a computer (CPU, memory, I/O, and clock), the most important part is the CPU. The CPU consists of several subgroups, including the arithmetic and logic unit (ALU), the instruction decoder, the program counter, and a bank of internal memory cells called registers. In a typ...
View Full Document
This note was uploaded on 12/01/2009 for the course S ss taught by Professor S during the Spring '09 term at Universidad Autonoma de Nuevo Leon - School of Business.
- Spring '09