EE 552
Final Report
for
Radio Frequency PSK
Transmitter/Receiver
Norman Bo 343026
Kelvin Leung 344621
David Ritter 346468
The goal of this project was to implement a digital RF transmitter and receiver. Binary data is transmitted using PSK (Phase Shift Keying) modulation, currently at a carrier frequency of 800 kHz. A receiver, with knowledge of the frequency but not the phase of the carrier, can receive this signal and demodulate it to recover the original signal. Optional enhancements to the project that are not at this time fully tested include a microprocessor interface to both the transmitter and receiver, variable carrier frequencies and data rates, and carrier frequency recovery at the receiver.
General Description
The NKD1000TX transmitter is a flexible general purpose PSK modulator/transmitter. The device supports multiple modes of operation, and multiple carrier frequencies and bit transmission rates. The device can be integrated with a microprocessor or other external device through a standard interface. The device also includes a matrix keypad interface for testing purposes.
Features
Keypad test mode
8-bit microprocessor interface
Serial or parallel data input
Carrier frequency: 24.6 kHz to 3.15 MHz
Bit Rate: 96 bps to 1.57 Mbps
No external circuitry required
Electrical Characteristics
Please refer to Altera Flex10K20 documentation.
Application Hints
This section describes details of the operation of the transmitter that may be of use to developers using the device.
The mode signal, selecting keypad test mode or microprocessor control mode, should be asserted at the rising edge of the reset signal.
Keypad test mode operates at a constant carrier frequency of 800 kHz, and a bit rate of 50 kbps. Key presses are decoded into an 8 bit data word based on the row and column of the key pressed.
In microprocessor mode, the RS inputs select one of 4 registers: data register (RS=00), carrier control register (01), hold control register (10), and mode control register (11). The data register is used to supply 8 bit data words for transmission. The carrier control and hold registers should be written to with a logic 1 in one of the bit positions. The position specifies the clock divider used, according to the following table:
Bit position (N) | Divider (D) |
1 | 2 |
2 | 4 |
3 | 8 |
4 | 16 |
5 | 32 |
6 | 64 |
7 | 128 |
8 | 256 |
The carrier frequency is determined by dividing the external oscillator frequency by 4 * DCarrier. The bit rate is equal to the carrier frequency divided by DHold.
The mode control register is as shown:
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
X | X | X | X | X | X | X | SM |
The SM bit selects serial input mode. In this mode, the data stream modulated by the carrier is taken from an input pin to the device. A clock at the appropriate rate of bit transmission is supplied as an output.
The tx_signal output pin can be connected directly to an antenna. The signal can be buffered and amplified before transmission, if desired.
Implementation Details
The device is implemented on an Altera Flex10K20 FPGA. The device requires 315 logic cells. It can operate with an external oscillator frequency of up to 28.01 MHz.
Pinouts
Signal | FPGA Pin | Altera Board Pin |
o_row0 | 109 | FlexB 15 |
o_row1 | 111 | FlexB 17 |
o_row2 | 114 | FlexB 19 |
o_row3 | 116 | FlexB 21 |
i_col0 | 118 | FlexB 23 |
i_col1 | 120 | FlexB 25 |
i_col2 | 127 | FlexB 27 |
i_col3 | 129 | FlexB 29 |
i_mode | 50 | FlexA 19 |
o_tx_signal | 53 | FlexA 21 |
i_osc | 91 | Clock |
i_reset | 28 | PB A |
i_en | 175 | FlexC 15 |
i_cs | 181 | FlexC 16 |
i_rs0 | 182 | FlexC 17 |
i_rs1 | 183 | FlexC 18 |
i_dataword0 | 184 | FlexC 19 |
i_dataword1 | 185 | FlexC 20 |
i_dataword2 | 186 | FlexC 21 |
i_dataword3 | 187 | FlexC 22 |
i_dataword4 | 188 | FlexC 23 |
i_dataword5 | 190 | FlexC 24 |
i_dataword6 | 191 | FlexC 25 |
i_dataword7 | 192 | FlexC 26 |
NKD1000RX Radio Frequency PSK Receiver
General Description
The NKD1000RX receiver is a flexible general purpose PSK demodulator/receiver. The device provides two demodulation modes, and can receive signals at multiple carrier frequencies and bit transmission rates. The device can be integrated with a microprocessor or other external device through a standard interface. The device also includes 7 segment LED output for testing purposes.
Features
Electrical Characteristics
Please refer to Altera Flex10K20 documentation.
Application Hints
This section describes details of the operation of the receiver that may be of use to developers using the device.
The mode signal, selecting either test mode or clock recovery mode, should be asserted at the rising edge of the reset signal.
Test mode supports a signal carrier frequency of 800 kHz and a bit rate of 50 kbps only.
Clock recovery mode allows recovery of signals with carrier frequencies up to 3.15 MHz and as low as 24.6 kHz.
Implementation Details
The device is implemented on an Altera Flex10K20 FPGA. The device requires 366 logic cells. It can operate with an external oscillator frequency of up to 26.88 MHz.
Pinouts
Signal | FPGA Pin | Altera Board Pin |
i_clock | 91 | Clock |
i_reset | 28 | PB A |
i_mode | 70 | FlexA 33 |
i_rx_signal | 53 | FlexA 21 |
o_led0 | 17 | Digit2a |
o_led1 | 18 | Digit2b |
o_led2 | 19 | Digit2c |
o_led3 | 20 | Digit2d |
o_led4 | 21 | Digit2e |
o_led5 | 23 | Digit2f |
o_led6 | 24 | Digit2g |
o_led7 | 25 | Digit2dec |
o_valid | 109 | FlexB 15 |
o_word0 | 111 | FlexB 17 |
o_word1 | 114 | FlexB 19 |
o_word2 | 116 | FlexB 21 |
o_word3 | 118 | FlexB 23 |
o_word4 | 120 | FlexB 25 |
o_word5 | 127 | FlexB 27 |
o_word6 | 129 | FlexB 29 |
o_word7 | 132 | FlexB 31 |
1.0 Project Overview *
1.1 Digital transmitter *
1.1.1 Keypad Decoder *
1.1.2 Buffer *
1.1.3 Parallel to Serial Converter *
1.1.4 Mixer *
1.1.5 Clock Generator *
1.1.6 Transmitter *
1.2 Digital Receiver *
1.2.1 Serial to Parallel Converter *
1.2.2 Demodulator *
1.2.3 Sample Pulse Generator *
1.2.4 Liquid Crystal Display Driver *
1.3 Additional Features (Untested) *
1.3.1 Microprocessor Interface *
1.3.2 Clock Recovery *
2.0 Design Details *
2.1 Transmitter *
2.1.1 Keypad Interface *
2.1.2 Microprocessor Interface *
2.1.3 Buffer *
2.1.4 Parallel to Serial Converter *
2.1.5 Carrier/Clock Generator *
2.1.6 Mixer *
2.2 Receiver *
2.2.1 Pulse Generator *
2.2.2 Demodulator *
2.2.3 Clock Recovery *
2.2.4 Serial to Parallel Converter *
2.3 External Circuitry *
2.4 IF Theory *
3.0 Experiments *
3.1 Design Experiments *
3.1.1 Transmitter *
3.1.2 Receiver *
3.2 Logic Cell Requirement Experiments *
3.3 Clock Speed Experiments *
4.0 Design Verification *
4.1 Receiver Entities *
4.2 Transmitter Entities *
5.0 IC Test Measurements *
6.0 Design Documentation *
6.1 e_transmitter *
6.2 e_clock_gen *
6.3 e_keypad *
6.4 e_control *
6.5 e_buffer *
6.6 e_ps *
6.7 e_mixer *
6.8 e_rxer *
6.9 e_demod *
6.10 e_pulse_gen *
6.11 e_clock_recover *
6.12 e_sp *
7.0 References *
A digitally synthesized radio transmitter and receiver are to be constructed to send and receive digital data.
Input data from a matrix keypad is buffered, and converted from parallel to serial form. These serial data are used to modulate the carrier. The modulated signal is then sent to a buffer and transmitted to the antenna. The transmitter is designed to have a carrier frequency of approximately 800kHz.
A microprocessor interface is available at the transmitter for data and control information. With the microprocessor interface, the transmitter is capable of providing multiple carrier frequencies and bit transmission rates.
The modulated signal is received by the antenna at the receiver. The signal is then amplified and sent to a fast comparator to adjust the signal level. The digital signal is then demodulated and de-framed. The final 8-bit word of data is then recovered.
The keypad decoder polls the keypad by writing a single 0 bit to one of the lines of the keypad. The column lines are checked for 0 bits. Any 0 bits found indicate a key is pressed. The bit vector corresponding to the key press is formed by concatenating the row lines that were output with the received column lines.
The buffer stores the decoded data from the keypad and latches to the parallel to serial converter when data request is enabled from the converter. The buffer also sends a data valid signal to the converter. When the buffer is empty, the valid signal will fall. It is in the buffer stage that the 8-bit word is combined with the framing bits (1102).
1.1.3 Parallel to Serial Converter
The converter accepts an 11-bit frame from the buffer and outputs a serial stream of data bits. The most significant bit of the input frame is the first bit output by the converter. The converter generates a data valid signal to the mixer to indicate that the data should be transmitted.
The mixer modulates the serial stream of data bits from the P/S converter with the carrier square waves generated in the clock generator entity. The mixer is enabled by the data valid signal from the P/S converter; if the valid signal is low, no transmission will occur.
The clock generator is used to generate a clock with lower frequency. It accepts the 25.175MHz signal from the crystal on the Altera board. Using counters, this entity generates the two carrier square waves, along with a system clock.
The transmitter entity combines the components of the transmitter. This entity includes logic to select appropriate inputs for each entity. The selection is controlled by the Mode input, and by the microprocessor interface entity, e_control. Input to the buffer can be taken from the keypad or from the microprocessor interface. Input to the mixer can be taken from the p/s converter or from an external serial data source.
1.2.1 Serial to Parallel Converter
The converter accepts a series of bits from the demodulator and outputs a parallel stream of data. Eleven bits of data are received and stored in a buffer for de-framing. The framing bits 1102 are compared to the first three bits of the data. If they are identical, the low order 8 bits of data are output, and the valid signal is asserted. If they are different, the data will be shifted by one bit with each new serial bit. The first three bits are again compared to the framing bits until they match. The converter generates an output valid signal (o_valid) to indicate that the data is correct.
The demodulator is implemented as a finite state machine. When it detects a bit stream of 11002 (indicating a 1 before modulation), it will output (serially) 11112, when it sees 01102 (indicating a 0 before modulation), it will output 00002. When the demodulator finishes demodulating the 8-bit signal, it will return to the stop state and generates a stop signal. Note that the pulse generator will generate a clock at the rate of bit reception, which will indicate when the s/p converter should sample the demodulator output.
The generator is initiated by the rising edge of the received signal from the antenna. If there is no signal being transmitted, the pulse generator will stop all other receiver components. The pulse generator will generate sampling pulses at 1/8, 3/8, 5/8 and 7/8 of a carrier period, and will also generate a bit clock which will be used to clock the s/p converter.
1.2.4 Liquid Crystal Display Driver
This entity is used to initialise and write received data from the receiver onto the LCD screen. The entity is completed but not yet implemented onto the receiver. Ultimately, it will replace the LED we have right now that displays the received signal. This entity is a combination of different VHDL LCD driver that different groups have used in the pass, with some modification added to fit our needs. What it will do is that it will initialise the LCD when the reset button is pushed and it will decode and write the received signal onto the LCD when both a valid signal and a 8-bit vector is received.
1.3 Additional Features (Untested)
1.3.1 Microprocessor Interface
This component provides a microprocessor interface with the transmitter. The operation of the interface is fully described in the test cases. Note that while the e_control entity that implements this entity has been fully tested, the operation of this entity within the transmitter has not been verified.
The clock recovery component provides an alternate method of recovering the data signal from a modulated signal. The clock recovery entity requires no knowledge of the carrier frequency or the rate of bit transmission, although the oscillator frequency should be the same as that used by the transmitter. The carrier frequency can be at most 1/8 of the oscillator frequency.
The clock recovery method first determines the length of a received pulse, and uses this as a reference to determine when to sample later pulses. The number of equal width pulses is then used to determine the bit rate. Since the frame bits "110" initiate each frame, the number of carrier cycles per bit is one half the number of equal width pulses.
With the carrier and bit rates determined, the sampling and decoding method is similar to that used in the demodulator component described above.
Note that simulation of each entity has been performed and the results are included in appendix B. These simulations can be used as supplemental information regarding the operation of each component described in the following section.
The transmitter is composed of 6 functional blocks. These blocks are the clock/carrier generator, mixer, parallel to serial converter, input buffer, keypad interface and microprocessor interface.
The design is based on the use of a multiplexer as a mixer. The data bit to be transmitted is used to select one of two separate carriers, which are separated in phase by 90 degrees. The two carriers are generated by the clock generator module. The data bits are supplied by the parallel to serial converter, which in turn is supplied with data through the input buffer, which receives input from either the keypad interface or the microprocessor interface.
The function of each block is described below.
The keypad interface is primarily included in the design for purposes of testing. Using a keypad provides a simple method to provide data to the transmitter.
The keypad interface operates by polling the keypad continuously. On alternate clock cycles, the row lines are and the columns are read and tested. Each row is individually driven low, and columns are tested for '0' bits. Each '0' column indicates a key is pressed. The key press is assigned an 8-bit code based on the row and column values. The 8-bit code is inefficient for storing a 4x4 matrix keypad key press. However, it is capable of storing multiple simultaneous key presses. Also, as the purpose of the keypad is as a testing mechanism, it provides a simple testing mechanism for the transmitter.
Note that key debouncing is accomplished by using a slow clock for polling the keypad, combined with the process of writing rows and reading columns on alternate clock cycles.
The keypad interface communicates with the rest of the transmitter through an 8-bit parallel data word, and a control signal, new, which is pulsed when a new key press is detected.
2.1.2 Microprocessor Interface
The microprocessor interface provides data and control registers which can be written to by external devices. This interface is only enabled in microprocessor control mode.
The EN signal must be low. This input can be connected to a microprocessor's read/write output. The CS signal is the device chip select. The RS signals are the transmitter's register select inputs. These can be connected to a microprocessor's address lines.
Data from the 8-bit data bus is read on the rising edge of CS. The value of the RS lines is used to determine the destination of the data.
For RS=00, the data is written to the data register. This causes the microprocessor interface to pulse the new signal, and to supply the 8-bit word to the buffer.
For RS=01, the carrier control register is written to. The data is decoded using the following scheme. From the lowest bit to the highest, each bit is tested. The highest bit which is set is used to determine the clock divider used to generate the carriers. If bit 0 is set, the divider is set to 2. If bit 1 is set, the divider is set to 4. In other words, if bit n is set, the divider is set to 2n+1. Since the carrier is pre-divided by 4, this allows dividers from 8 to 1024 to be applied when generating the carrier, and allows carrier frequencies from 3.15 MHz down to 24.6 kHz to be specified.
For RS=10, the hold control register is written to. The data is decoded using the same method applied to the carrier control register. This divider determines the number of carrier periods for which each data bit is held. Each bit can be held for 2 to 256 carrier periods. Thus, the data rate depends on both the carrier frequency and the bit hold duration, and can vary from 96 bps to 1.57 Mbps.
RS=11 selects the mode control register. The most significant 7 bits are ignored. The least significant bit selects serial input mode. In this mode, data is taken from an external serial data source instead of from the parallel to serial converter.
The buffer stores input data words until the parallel to serial converter is ready to accept them. This buffer only has a capacity of one word. When using keypad test mode, this is acceptable, as the key debouncing cycle ensures that data words arrive at well separated intervals. When using the microprocessor interface, the external device should only write data words if the request line is high, indicating that the parallel to serial converter is ready to accept data.
The buffer detects pulses on the new signal to determine when to read data words from the microprocessor interface or the keypad. If the buffer currently contains valid data, this new data will be discarded. Otherwise, the data will be read, and the word_valid signal will be asserted. If the request signal falls while word_valid is asserted, the output of the buffer has been latched by the parallel to serial converter, and the buffer can now accept new data. The word_valid signal will be driven low to indicate that the data in the buffer has already been used.
The buffer is also responsible for adding frame bits to each data word. The 3 bit Barker code 1102 is added to the beginning of each word, and a stop bit, 1, is added to the end of each word.
2.1.4 Parallel to Serial Converter
This converter takes as input a 12-bit frame from the buffer component. The frame is read from the buffer if the converter has asserted request and the word_valid signal is high. When the frame has been read, the request line will be driven low. When a new frame is read into the parallel to serial converter, the converter begins outputting serial bits from the MSB to the LSB. While the frame is being converted, the converter asserts the bit_valid signal. This indicates to the mixer that a data word is being transmitted. When the frame is completely converted, the bit_valid signal will be driven low.
The rate at which bits are output from the converter is determined by the bit rate clock, whose frequency depends on the mode of operation and the values of the carrier and hold control registers described in the previous section.
This component is responsible for generating clocks and carriers for the other components of the transmitter.
A master clock is generated by dividing the external oscillator frequency by 2. This master clock is used to generate the carriers and other clocks. To generate the carriers, and a counter is used to count up to the required carrier divider. This divider is either preset when in test mode, or set by the microprocessor interface when in microprocessor mode. When the count reaches the required value, a flag is used to determine which carrier should be changed. Based on this flag, a transition is forced on one of the carriers. This operation causes the two carriers to be separated in phase by 90 degrees.
Another counter is used to count the transitions of carrier1. When this counter reaches the value specified for the bit clock rate (either by the microprocessor interface or preset when in test mode), a transition on the bit rate clock will be forced.
Carriers are generated according to the following diagram, where the common clock is the master system clock, o_clock.
The two carriers generated by the clock generator are supplied as inputs to a multiplexer. The select input of the multiplexer is created by synchronising the output of the parallel to serial converter with the rising edge of carrier1. This synchronisation forces data transitions to occur at predictable positions in the transmitter waveform, and thus simplifies the decoding process.
The output of this multiplexer is supplied to another multiplexer as one input. The other input is tied to ground. The select input is the bit_valid signal. This causes the transmitter to turn off when no valid data is being transmitted.
The operation of the mixer can be summarised by the following diagrams, which show the mixers operation when the enable input is high. When the enable input is low, the output of the mixer will be low.
The above diagram shows the waveform resulting from a 0 to 1 transition.
The receiver uses two methods to decode received signals. The first method uses a finite state machine, which sample the received waveform at specific points to detect transitions in the data. To ensure that the waveform is sampled at the correct points, a sampling pulse generator is used, which bases sampling pulse position on the timing of the initiating start bit and the known carrier frequency. The second method, clock recovery, does not require a known carrier frequency. Its operation is described in detail below.
This module is responsible for generating sampling pulses as well as the bit rate clock for test mode operation of the receiver. The clocks are generated only when the receiver is not stopped. When stopped, the pulse generator does not generate clocks. When a rising edge on the received signal is detected, the generation of pulses starts. This is accomplished using clock dividers. Pulses are generated at 1/8, 3/8, 5/8 and 7/8 of a carrier period. These pulses are used to clock the demodulator FSM. The bit rate clock is generated with a falling edge at the midpoint of each data bit. To provide this edge, a counter is used to count sampling pulses.
When the demodulator FSM determines that the signal has stopped, it will assert the stop signal. When this signal is asserted, the pulse generator will stop generating sampling and bit rate clocks, until a new rising edge on the received signal is detected.
The operation of the pulse generator is summarised by the following diagram:
In addition, a bit rate clock is generated based on the bit rate clock divider, which is hard coded into the pulse generator. The number of sampling pulses is counted to determine when transitions should occur on the bit rate clock.
Demodulation is accomplished using a FSM. The state diagram is included on the following page. The clock for the FSM is provided by the pulse generator component. The input is read from the received signal. The outputs are the decoded signal and the stop signal, respectively.
This component is intended to allow recovery of signals without knowledge of the carrier rate of the bit rate. Recovery is based on the start bits, 110. By counting the width of each of the first two pulses, the receiver can determine the carrier frequency. By counting the number of equal width pulses, the bit rate can be determined. The first unequal width pulse will occur at the 1 to 0 transition at the beginning of the third start bit. Thus, the number of equal width pulses can be divided by 2 to determine the number of pulses in each bit.
After determining the carrier frequency and the bit width, this component will continue to measure pulse width to detect transitions in the data bits.
Note that this component replaces both the pulse generator and demodulator FSM when operating in clock recovery mode.
The series of steps used in decoding a received waveform is described below. The execution of these steps is controlled by a FSM.
Determine width of first 1 pulse by counting at fast clock
rate.
Determine width of first 0 pulse.
Count the number of equal width pulses.
Determine the width and logic level of the transition pulse. This pulse
indicates a 1 to 0 transition.
Decode the remaining bits. During this process the following steps are
performed
Force transitions on the bit rate clock twice per bit. Output the data
bit at the rising edge, ensuring that it will be ready when read at the
falling edge of the clock.
Measure the width of each pulse. Noting that transitions occur on either
logic level 1 pulses or logic level 0 pulses (not both), one type of pulse
can be ignored. If the pulse width is different than the normal pulse width,
as determined in step 1 or 2, a transition is known to have occurred. The
1 to 0 transition width has been determined in step 4, and it is used to
determine if the transition is a 1 to 0 transition or a 0 to 1 transition.
The appropriate output bit is placed in an output buffer.
Output remaining bits in buffer.
2.2.4 Serial to Parallel Converter
This converter receives data bits from either the demodulator FSM or the clock recovery component. The bits are read on the falling edge of the bit rate clock, which is generated by either the pulse generator or the clock recovery module. The bits are placed in a 12- bit buffer in the order in which they are received. When the buffer is full, the most significant 3 bits are compared to the expected frame bits, 110. If a match is detected, the 8 data bits are latched to the output and the valid signal is pulsed. This pulse can be used as an interrupt for an external microprocessor, which can then read from the parallel output. Note that tri-state buffers should be placed between the parallel output and the microprocessor.
If the frame bits do not match, the data in the buffer will be shifted by one bit as each new bit is received, until a match is detected.
The output is also decoded into 7-segment display outputs for testing purposes.
The operation of the serial to parallel converter is summarised by the following diagram:
These are experiments that were performed to improve the design or implementation of specific components of the project. These changes were made not to improve space or speed considerations.
Aside from miscellaneous coding errors, few changes were made to the original design of the transmitter. The one relatively major change made to the transmitter was the addition of a stop bit to the transmitted frame. This change was necessitated by the design of the receiver, and does not reflect any requirements of the transmitter itself.
The receiver's initial design was extended with the clock recovery module. This module was written twice. The first attempted clock recovery method used the width of the initial pulses to determine when to sample the waveform. The second method measures the width of every pulse, and uses variations in pulse width to determine the data bits being received.
The first method works reasonably well under controlled conditions. The fact that it uses pulse widths to determine sampling intervals means that a divider must be used. This divider can be implemented by shifting, since sampling intervals occur at multiples of 1/4 of a pulse width (1/8 of a carrier period). However, when the pulse width is small and not a multiple of 4, the division is only an approximation. The error in dividing results in improper spacing of sampling intervals, and will result in erroneous decoding of the received waveform. Thus, the original clock recovery scheme will only work if the pulses are large, compared to the fast receiver clock, or if the pulse width is a multiple of 4 times the fast receiver clock.
The second method corrects this problem by largely eliminating the need for division. Division in this scheme is used only to determine the location of the output bit clock transitions, and not in decoding the received waveform.
3.2 Logic Cell Requirement Experiments
Experiments regarding chip area used were largely unnecessary in this project. Both devices will easily fit on a single Flex10K20 FPGA. As they are designed to be separate devices, they are not normally placed on a single FPGA. When separate, the devices fit even more easily on the FPGA's. The only modifications made to the code to reduce chip area used was to specify ranges on integer type variables.
Device speed also proved to be acceptable in most cases. The transmitter can operate with a clock speed of up to 28 MHz. The receiver can also operate at speeds greater than that of the supplied external oscillator, with the exception of the clock recovery module. This module can operate at approximately half the rate of the supplied oscillator. The clock is divided before supplying it to this module.
The effect of the slower rate of operation of the clock recovery module is that it cannot demodulate signals with a carrier frequency of greater than 3.15 MHz. As this is the current maximum carrier frequency of the transmitter, this limitation is acceptable.
Simulation results are included in appendix B.
Testing of the complete designed was performed using digital oscilloscope readings to verify correct generation of transmitted waveforms and to verify correct operation of the receiver. The use of these tools was complemented by the use of the keypad and LED test mechanisms.
Internal operations of the devices were analysed using the oscilloscope by exporting internal signals as buffer outputs in each entities port definition. This aided in debugging the circuit.
Final correct operation of the system was verified using the keypad and LED test mechanisms. If the output of the LED matched the key pressed, the system's operation was verified.
A description of each design entity follows.
This entity incorporates the individual components of the transmitter. This entity also defines the data paths between the entities. In several cases control signals determine the source of data for input to an entity. The mode signal selects the new signal and the word signal from either the e_keypad entity or the e_control entity as input to the e_buffer entity. The bitmode signal from the e_control entity selects the bitstream input for the mixer, from either the e_ps entity or from the external bitstream input.
The components instantiated in this entity are described below: e_clock_gen, e_mixer, e_keypad, e_control, e_buffer, and e_ps.
The port definition for this entity exports many internal signals as buffer outputs. These signals are prefixed by a s_ or v_ indicator. These signals can be ignored externally. The signals prefixed by i_ and o_ are true input or output signals, and are listed below:
i_osc : external oscillator
i_reset : system reset
i_mode : mode select (keypad test = 0, microprocessor control = 1)
i_cols : keypad column lines
o_rows : keypad row lines
o_tx_signal : modulated signal
o_clock_bit : bit rate clock (for external serial data sources)
i_dataword : 8-bit data port (for microprocessor interface)
i_rs : register select
i_cs : chip select
i_en : enable (equivelant to R/W)
i_bitstream1 : external serial data input
This entity is responsible for generating carriers and system clocks for the transmitter. The operation of the clock generator is described in section 2.1.5.
The port definition for e_clock_gen includes the following signals:
i_osc : external oscillator
i_div : carrier frequency clock divider
i_type : modulation type (1 = ASK, 0 = PSK)
o_clock : master clock
o_clock_bit : pre-division bit rate clock
o_carrier0 : carrier representing data at logic '0'
o_carrier1 : carrier representing data at logic '1'
The e_keypad entity polls an 4x4 matrix keypad at a reduced clock rate. The master system clock is divided by 218 to determine the rate of keypad polling. The column lines are read on alternate clock cycles to ensure that key presses are debounced.
When a key press is detected, an 8-bit word is latched to the word output of the e_keypad component, and the new signal is pulsed.
The operation of this component is further described in section 2.1.1.
The port definition of the e_keypad entity includes the following signals:
i_clock : master system clock
i_reset : system reset
o_word : output data word
o_new : new data signal
o_rows : keypad row lines
i_cols : keypad column lines
The e_control entity defines the microprocessor interface to the transmitter.
As described above, data is latched to the appropriate register on the rising edge of the CS input, if the EN is low. The meaning of each register is described in section 2.1.2.
After latching the data to the appropriate register, the data is synchronized with the master system clock before being output to the rest of the transmitter.
The port definition of the e_control entity includes the following signals:
i_en : enable (R/W)
i_rs : register select
i_cs : chip select
i_clk : master system clock
i_reset : system reset
i_data : input parallel data port
o_data : output data word (data to be transmitted)
o_new : new data signal
o_bitmode : serial data input mode select
o_clock_bit : bit rate clock (for external serial data sources)
o_clockdiv : carrier frequency clock divider
o_holddiv : bit rate clock divider
The input buffer component serves to isolate the parallel to serial converter from the input data sources. This buffer stores a single data word. Once it has received data, it will ignore any incoming data until the stored word has been passed to the p/s converter.
The request line allows the p/s converter to signal the need for data. The new signal allows the data sources (keypad and microprocessor interface) to indicate incoming data.
The e_buffer component also adds the frame bits to the data word.
A complete description of the e_buffer component is included in section 2.1.3
The port definition for the e_buffer component includes the following signals:
i_word : input data word
i_request : output data requested (by p/s converter)
i_new : new data available (from keypad or microprocessor interface)
i_clock : master system clock
i_reset : system reset
o_valid : output data valid (to p/s converter)
o_frame : output data frame (word + frame bits)
The e_ps component implements a parallel to serial converter. Data frames are latched from the input when the input valid signal is asserted and the request output is high. After latching data, the request line falls until the entire frame has been converted, and the output valid signal is asserted until the frame is converted.
The rate of conversion is determined by the i_div input, which is used to determine the extent of clock division. Each bit is output after i_div clock cycles. The clock used to drive the p/s converter is at the carrier frequency (ie. not the master clock).
The port definition for the e_ps entity includes the following signals:
i_frame : input parallel frame
i_clk : carrier rate clock
i_reset : system reset
o_bitstream : serial output
o_request : new data requested (to buffer)
i_valid : input parallel data valid
i_div : bit rate clock divider
o_valid : serial output valid
The mixer selects the appropriate carrier signal based on the data input. The enable input is used to stop operation of the mixer. When enable is low, the transmitter output will be a constant logic 0. When high, the appropriate carrier will be transmitted.
A complete description of the mixer is included in section 2.1.6.
The port definition for the e_mixer entity includes the following signals:
i_carrier0 : carrier representing logic 0
i_carrier1 : carrier representing logic 1
i_bitstream : serial input data (to be transmitted)
i_enable : enable (valid output from p/s converter)
i_clock : external oscillator
i_reset : system reset
o_tx_signal : modulated signal
This entity instantiates the individual receiver components. The data paths between the components are also defined in this entity. In particular, the mode input is used to select either the clock recovery module or the FSM demodulator as the source for input to the serial to parallel converter.
The e_rxer component also performs decoding for the seven segment LED output.
The port definition for the e_rxer entity includes the following signals:
i_clock : external oscillator
i_rx_signal : received RF signal
i_reset : system reset
i_mode : demodulation mode (1 = clock recovery, 0 = standard)
o_word : output parallel data port
o_valid : output data valid
o_led : 7 segment LED output
The e_demod component describes the FSM demodulator. The state diagram for this FSM is included in section 2.2.2. The clock input for this FSM is generated by the e_pulse_gen component. Input is taken from the received signal, and the output consists of the decoded bitstream and a stop signal, which is used to stop the pulse generator (and thus the rest of the receiver) when the FSM demodulator determines that the signal is idle.
The port definition for the e_demod component includes the following signals:
i_clock : external oscillator
i_reset : system reset
i_input : received RF signal
o_output : o_output(1) = decoded output, o_output(0) = stop signal
This component is responsible for generating both sampling pulses for the e_demod component and a bit rate clock for the serial to parallel converter. Both clocks are generated using the standard method, a counter which must count to a defined value before a transition on the clock signal occurs. The counters are reset when the pulse generator receives a stop signal from the demodulator. Thus, each time a new signal starts, the pulses are synchronized with that signal, and the phase relationship between the sampling pulses and the input waveform should be appropriate.
A complete description of this component is included in section 2.2.1.
The port definition for the e_pulse_gen component includes the following signals:
i_osc : external oscillator
o_bitclock : bit rate clock
o_pulse : sampling pulse
i_rx_signal : received RF waveform
i_reset : system reset
i_stop : stop signal (from demodulator)
This module describes the clock recovery component. A complete description of this component can be found in section 2.2.3.
The port definition for the e_clock_recover entity includes the following signals:
i_rx_signal : received RF waveform
i_osc : external oscillator
i_reset : system reset
o_bitstream : decoded output
o_bitclock : bit rate clock
The e_sp module implements a serial to parallel converter with frame synchronization. The converter reads input bits on the falling edge of the bit rate clock. These are placed in a buffer in the order in which they are received. When a complete 11-bit frame has been received, the first three bits are compared with the expected frame bits. If a match is found, the buffer's contents are latched to the output and the valid signal is pulsed. Otherwise, the data is shifted one position for each new bit received until a match on the frame bits is found.
A complete description of this component can be found in section 2.2.4.
The port definition for the e_sp entity includes the following signals:
i_bitstream : input data bits
i_clk_bit : bit rate clock
i_reset : system reset
o_word : output parallel data word
o_valid : output data valid signal
Best, Roland E. Phase Locked Loops: Theory, Design and Applications. McGraw-Hill.
Danzer, Paul. The AARL Handbook For Radio Amateurs. AARL.
Filanovsky, Igor M. EE 571 Lab Notes. U of A, 1999.
Forcadas, John and Snip, Anco. EE552 Project: Digital Synthezied Radio Transmitter.
http://www.ee.ualberta.ca/~elliott/ee552/projects/97f/radiotx.html
Grebene, Alan B. Bipolar and MOS Analog Intergrated Circuit Design. Wiley-Interscience.
Kanefsky, Morton. Comunnication Techniques for Digital and Analog Signals. Harper & Row: New York, 1985.
Li, Shum, Wong, and Wong. Dot Matrix LCD Controller and Driver. http://www.ee.ualberta.ca/~elliott/ee552/studentAppNotes/98f/LCD_Driver/app.htm
National Semiconductor. National Operational Amplifiers Data Book. National Semiconductor, 1995. pg 3-46.
Oppenheim, Alan V., and Schafer, Ronald W. Discrete-Time Signal Processing. Prentice-Hall: Englewood Cliffs, 1989.
Peebles, Peyton Z. Jr. Digital Communication Systems. Prentice-Hall: Englewood Cliffs, 1987.
Smith, Jack R. Modern Communication Circuits. McGraw Hill.