TAMS / Java / Hades / applets: contents | previous | next | ||||
Hades Applets contents visual index introduction std_logic_1164 gatelevel circuits delay models flipflops adders and arithm... counters LFSR and selftest memories programmable logic state-machine editor misc. demos I/O and displays DCF-77 clock relays (switch-le... CMOS circuits (sw... RTLIB logic RTLIB registers latches registers counter shift-register 16-bit setta... ROM RAM DPRAM stack stack address-decoder byte- vs. wo... memory demo ALU (user-de... PIO 8255 PIO 8255 USART 8251 8251 text-to... 8251 transmi... 8251 databit... 8251 parity ... 8251 prescaler 8251 loopbac... 8251 loopbac... 8251 error d... microprogram full micropr... 1-address da... 3-address da... 2-address da... Prima processor D*CORE MicroJava Pic16 cosimulation Mips R3000 cosimu... Intel MCS4 (i4004) image processing ... [Sch04] Codeumsetzer [Sch04] Addierer [Sch04] Flipflops [Sch04] Schaltwerke [Sch04] RALU, Min... [Fer05] State-Mac... [Fer05] PIC16F84/... [Fer05] Miscellan... [Fer05] Femtojava FreeTTS | USART 8251 clock prescaler demonstration
Circuit Description
This applet demonstrates the clock prescaler feature of the
USART 8251 or
universal synchronous and asynchronous receiver and transmitter.
For an overview and register description of the USART chip,
please visit the 8251 overview applet page.
This applet is essential the same as the USART 8251 transmitter demo shown in one of the previous applets. Again, the USART is configured to use eight databits, no parity, and two stopbits, and the serial terminal is setup to those same parameters at 600 baud. The only difference is that the clock-prescaler of the 8251 chip is enabled, at a rate of 16 times. Therefore, the nTXC transmitter bit clock period is now set to 0.104166 milliseconds (1/(600*16)), which again results in a data rate of 600 baud. The clock prescaler is selected together with the serial communication parameters when writing the mode command to the 8251 chip. The available ratios are 1:64, 1:16, and 1:1 (no prescaler); see the register description in the USART overview page or the original datasheet for details. Using the clock prescaler has two advantages. First, typical quartz oscillators generate frequencies in the megahertz range, while typical baud rates are multiples of 300 baud up to 19200 baud. Having a prescaler on chip means that less external logic is needed to subdivide the quartz oscillator frequencies to the required range. Second, using a prescaler the receiver input signal can be sampled near the middle of the actual bit interval for improved robustness and less sensitivity to differences between transmitter and receiver bit clocks. Once the receiver first detects a startbit, the startbit is confirmed after eight (in 16X mode) or 32 (in 64X modes) input clock cycles, and subsequent data bits are sampled in the middle of the corresponding bit clock interval, also. As this applet only uses the transmitter to demonstrate the prescaler, the sampling of the input signal near the middle of the bit period cannot be seen here. Please run the USART loopback receiver demonstration applet and check that the RXRDY signal is at the middle of the bit period (eight clock after the last bit transition). The rest of the description is (essentially) the same as the description of the transmitter demo with prescaler. As you can see, the circuit shown in the applet uses a single 8251 chip, with its TXD data output connected to the RX receiver input of a serial terminal. Therefore, characters transmitted by the 8251 will be decoded and displayed by the terminal, as long as the communication settings of the transmitter and the terminal match. The TXC inputs of the 8251 is driven by a clock generator which is set to a clock period of 0.1041666 mseci - corresponding to 600 baud or 1.6666 msec per bits when considering the 16X prescaler. A stimuli generator component is used to automatically initialize the USART for transmission and to demonstrate the timing of the transmitter and its status signals. The communication parameters of both the 8251 and the terminal are set to eight databits, no parity, and two stopbits. Once the simulation starts, the stimuli generator component applies the following sequence of input changes to the circuit:
When the automatic sequence has finished, you should take a look at the signal waveforms to check and understand the RS-232 datastream and the values returned by the status register read operations. The waveform of the extra comment signal includes a short description of the ongoing operation. Just click the repaint button in the waveform viewer to update the waveforms, and use the zoom buttons or the zoom-region option to enlarge the areas of interest. For easy comparison between data bus values and transmitter waveforms, you might want to select hexadecimal number format in the waveform viewer (via menu, options, number format, hex). The screenshot below shows the nTXC input clock signal and the TXD data output during a little more than two bit periods in 16X prescaler mode.
To explore the circuit, just continue the simulation via clicking the "run" button (play) in the simulator control panel. You can now use the DATA input switch and the nWR write-enable switch to transmit other data characters via the USART chip. You can also type the following bindkeys to control the applet: 'r' for nRD, 'w' for nWR, 'x' for RESET.
| |||
Print version | Run this demo in the Hades editor (via Java WebStart) | ||||
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German) | ||||
Impressum | http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/50-rtlib/65-usart8251/usart-x16.html |