55:088 Prelab 3
10/28/2008
Joseph Altmaier Jared Beckman Tim Mansheim Kate Rasing
Problem statement
The objective of this laboratory is to determine the fundamental frequency of an analog input signal using zero-crossing techniques. This lab will develop a tone decoder based on the Bell 202 protocol consisting of a constant-phase train of 1200 Hz and 2200 Hz tones, representing the bits in a message to be communicated. These tones will be sent with an inverted non-return to zero (NRZI) signaling. The functionality of the decoder circuit will be tested using a provided application that will generate the data using a sound card. An application to use the decoder will also be developed. For this application, a packet will be sent to the PIC using the universal serial asynchronous receiver/transmitter (USART) serial communications protocol from an ASCII terminal on the PC. All packets should be displayed, even if they do not match the Frame Check Sequence (FCS), and should indicate the status of the FCS. All packets will have a payload no greater than 100 bytes.
Circuit schematic
Component Values R = 100kΩ C = 0.1 µF PIC Configuration PORTB: PORTB_CHANGE_INT_OFF & PORTB_PULLUPS_OFF TRISB: 0xFF USART: USART_TX_INT_OFF & USART_RX_INT_OFF & USART_SYNCH_MODE & USART_EIGHT_BIT & & USART_CONT_RX & USART_BRGH_HIGH USART spbrg: 64 USART baud: 9600
1 /4
55:088 Prelab 3
10/28/2008
Joseph Altmaier Jared Beckman Tim Mansheim Kate Rasing
PC Serial Configuration
Lab procedures
We will load our C code onto our PIC. We will load our Visual Basic program onto the PC, as well as the provided sound card application. Then, we will test the functionality of the program by sending data to the PIC via the sound card application and viewing the output on the Visual Basic program.
2 /4
55:088 Prelab 3
10/28/2008
Joseph Altmaier Jared Beckman Tim Mansheim Kate Rasing
Flow Charts
Figure 1: Overview of main PIC program
Figure 2: Overall flowchart for PIC
3 /4
55:088 Prelab 3
10/28/2008
Joseph Altmaier Jared Beckman Tim Mansheim Kate Rasing
Figure 3: Flow chart zdetect, a function for detecting the zero crossing and interpreting the data accordingly
GUI
4 /4