11.0. Test Results

 
    11.1. Test Session 1: FG Wilson Lab (26/02/2002)
        11.1.1. Test 1: Test RS232 Communications (TX Only)
        11.1.2. Test 2: Fully Test RS232 Communications
        11.1.3. Test 3: Test ADC
        11.1.4. Conclusion
    11.2. Test Session 2: FG Wilson Lab (05/03/2002)
        11.2.1. Test 4: Test RS232 Communications (Baud Rate Set by DIP Switches)
        11.2.2. Test 5: Fully Test RS232 Communications (Baud Rate Set by DIP Switches)
        11.2.3. Test 6: Test ADC, Scope Program and Real-time Communication Protocol
        11.2.4. Test 7: Test Timer Interrupts
        11.2.5. Conclusion
    11.3. Test Session 3: FG Wilson Lab (05/03/2002)
        11.3.1. Test 8: Dual Channel Test
        11.3.2. Test 9: Interrupt Driven Time-Base, Real-Time Sampling (Four Channels)
        11.3.3. Test 10: Test External RAM Chip
        11.3.4. Test 11: 5V Regulator
        11.3.5. Test 12: Analogue Circuitry
        11.3.6. Conclusion
 

 
11.1. Test Session 1: FG Wilson Lab (26/02/2002)
 
The circuit diagram shown in figure 11.1a was constructed on prototype board, with RS232 communication connected to laptop (COM1, 1GHz AMD processor, 256MHz SDRAM, 8MB 3D accelerator card, running windows XP).
 
Figure 11.1a. Test Circuit Diagram 1
 

 
11.1.1. Test 1: Test RS232 Communications (TX only)
 
Program mark1.c (version: 1.0) was compiled and loaded into PIC using Microchip MPLAB. This program is extremely simple, basically it transmits “Testing…” continuously with a 1 second delay between each “Testing…”. The DOS based test program (test.exe, version 1.05) was used in RX terminal mode to receive the incoming characters.
 
Screen dump of text.exe after a couple of minutes: -
RX Terminal
-----------
Waiting for message (press a key to stop)
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...Testing...Testing...Testing...
Testing...Testing...Testing...Testing...Testing...
 
Clearly the test was a success, and it has been proven that the transmit mode of the RS232 communications is working. Note: Baud rate = 9600bps, OSC = 4 MHz, RS232 cable length (unshielded) = 1.5m.
 
 

 
11.1.2. Test 2: Fully Test RS232 Communications
 
Program mark2.c (Version: 1.0) was compiled and loaded into PIC using Microchip MPLAB. This program is extremely simple; basically it waits for an incoming character and transmits it. This is a very simple method of fully testing the RS232 communication (PIC software, PIC, MAX232, cable, and wiring). The DOS based test program (test.exe, version 1.05) was used to carryout two separate tests. The first used the TX terminal to transmit a message, then the RX terminal is used to receive the message, if the RX & TX messages are identical the test is successful. The second used the loop back test function of the test program; this stresses the communications as a large amount of data is transmitted and compared with the received block of data.
 
Screen dump of test program (test.exe) in TX terminal mode then RX terminal mode: -
TX Terminal
-----------
Type your message, hit [ENTER] to transmit: -
 
Testing RS232 Communications
 
 
Sending Messaging: -
Testing RS232 Communications
 
Message sent successfully.
 
RX Terminal
-----------
Waiting for message (press a key to stop)
Testing RS232 Communications
 
Screen dump of test program (test.exe) after loop back test was completed: -
Test Started: 13:37:31
-----------------------------------
Testing            .... 100% - PASS
    * Test 1 - PASS
    * Test 2 - PASS
    * Test 3 - PASS
-----------------------------------
Test Finished: 13:37:33
 
 
 
Hit any [Key] to return to main menu
 
Clearly the RS232 communication tests were successful, note: baud rate = 9600bps, OSC = 4 MHz, RS232 cable length (unshielded) = 1.5m.
 

 
11.1.3. Test 3: Test ADC
 
Program mark3.c (Version: 1.1) was compiled and loaded into PIC using Microchip MPLAB. This program is a little more complex than the first two, basically it reads ADC CH1 (AN0), and transmits the result through RS232 using the real-time frame format, every 10ms (sample rate of 100Hz). The scope.exe (version 1.023a) program was used to display the real-time frames graphically, and a calibrated digital signal generator was use to generate a 0 to 5V (e.g. 5V peak to peak with a DC offset of 2.5V) sinewave at a variable frequency (e.g. 2Hz, 5Hz, 10Hz, etc…). Portable commercial digital storage oscilloscope was used to make sure that the signal generator output was 0 to 5V as values outside this range would damage the PICs ADC (analogue circuit not constructed at this stage).
Note: Sample rate = 100Hz, 100 horizontal samples are displayed on the scope display (10 samples per division). Hence scope time-base is 0.1 seconds per division that’s 10Hz. Note: time-base is fixed on this version of the scope program.
 
1Hz sinewave (0-5V) connected to CH1 (AN0), see figure 11.1.3a. 10 division per cycle, hence the calculated frequency of the waveform is 1/(10 * 0.1) = 1Hz.
 
Figure 11.1.3a. Screen dump of scope program (sample rate = 100Hz, input wave = 1Hz sinewave 0-5V)
 
2Hz sinewave (0-5V) connected to CH1 (AN0), see figure 11.1.3b. 5 divisions per cycle, hence the calculated frequency of this waveform is 1/(5 * 0.1) = 2Hz.
 
Figure 11.1.3b. Screen dump of scope program (sample rate = 100Hz, input wave = 2Hz sinewave 0-5V)
 
5Hz sinewave (0-5V) connected to CH1 (AN0), see figure 11.1.3c. 2 divisions per cycle, Hence the calculated frequency of this waveform is 1/(2 * 0.1) = 5Hz.
 
Figure 11.1.3c. Screen dump of scope program (sample rate = 100Hz, input wave = 5Hz sinewave 0-5V)
 
10Hz sinewave (0-5V) connected to CH1 (AN0), see figure 11.1.3d. 1 divisions per cycle, hence the calculated frequency of this waveform is 1/(1 * 0.1) = 10Hz.
 
Figure 11.1.3d. Screen dump of scope program (sample rate = 100Hz, input wave = 10Hz sinewave 0-5V)
 
20Hz sinewave (0-5V) connected to CH1 (AN0), see figure 11.1.3e. 0.5 divisions per cycle, hence the calculated frequency of this waveform is 1/(0.5 * 0.1) = 20Hz. But waveform is under sampled and heavily distorted, recall that the pulse interpolator display type (scope.exe uses this) required at least 10 sample / cycle before a recognisable sinewave can be plotted.
 
Figure 11.1.3e. Screen dump of scope program (sample rate = 100Hz, input wave = 20Hz sinewave 0-5V)
 
50Hz sinewave (0-5V) connected to CH1 (AN0), see figure 11.1.3f. Something real strange has happened here, clearly the result of under sampling.
 
Figure 11.1.3f. Screen dump of scope program (sample rate = 100Hz, input wave = 50Hz sinewave 0-5V)
 
100Hz sine-wave (0-5V) connected to CH1 (AN0), see figure 11.1.3g. 10 divisions per cycle, hence the calculated frequency of this waveform is 1/(10 * 0.1) = 1Hz. Clearly not correct, the reason for this is that the sample rate is not high enough and because sine-waves are periodical it is possible to get false time-base readings (e.g. aliasing). This will be a mayor concern at a later stage in the project, and will be investigated fully.
 
Figure 11.1.3g. Screen dump of scope program (sample rate = 100Hz, input wave = 100Hz sinewave 0-5V)
 
200Hz sinewave (0-5V) connected to CH1 (AN0), see figure 11.1.3h. 5 divisions per cycle, hence the calculated frequency of this waveform is 1/(5 * 0.1) = 2Hz. This signal is clearly an alias of the original signal (false signal).
 
Figure 11.1.3h. Screen dump of scope program (sample rate = 100Hz, input wave = 200Hz sinewave 0-5V)
 

 
11.1.4. Conclusion
 
Clearly the three tests that were carried out were completely successful and work can now start on the main real-time embedded program. Test 3, was extremely useful, as it was able to test fully the graphically display for a fixed sample rate. The triggering (negative to positive, 0 to positive in this case) worked, but the waveform was not completely stable, as the amplitude of samples varied slightly (due to noise, or/and tolerance of ADC) hence the waveform was continuously changing very slightly; sampling when the PIC is sleeping may reduce noise, hence a more stable waveform could be displayed (too slow to be practical). The PIC datasheet recommends not to use the ADCs internal oscillator when the PIC is running above 1MHz (unless sampling is done when PIC is sleeping), mark3.c uses the ADCs internal oscillator (not good) and this could explain why the waveform was continuously changing slightly (e.g. noise form PIC oscillator).
 
It was discovered that it is possible for the scope program to display perfect sine-waves at false time-based readings when the waveform is under sampled. This is a common problem which all digital scopes have called ‘aliasing’, frequency above half the sample frequency should be filter out. Note it may be possible to use this as an advantage as it makes it possible to monitor waveforms much higher than the sampling rate, improving the performance of the PC based scope program (if the real frequency could be detected).
 

 
11.2. Test Session 2: FG Wilson Lab (05/03/2002)
 
The circuit diagram shown in figure 11.2a was constructed on prototype board, with RS232 communication connected to laptop (COM1, 1GHz AMD processor, 256MHz SDRAM, 8MB 3D accelerator card, running windows XP).
 
Figure 11.2a. Test Circuit Diagram 2
 

 
11.2.1. Test 4: Test RS232 Communications (Baud Rate set by DIP Switches)
 
Program mark4.c was compiled and loaded into the PIC using Microchip MPLAB. This program is extremely simple (basically the same as mark1.c expect baud rate is set by the DIP switches), basically it reads the DIP switches and sets the baud rate, then it transmits “Testing…” continuously with a 1 second delay between each “Testing…”. The DOS based test program (test.exe, version 1.05) was used in the RX terminal mode to receive incoming characters.
 
All baud rates were tested and there were no problems.
 
 

 
11.2.2. Text 5: Fully Test RS232 Communications (Baud Rate set by DIP Switches)
 
Program mark5.c was compiled and loaded into PIC using Microchip MPLAB. This program is extremely simple; basically it reads the DIP switches and sets the baud rate, then it waits for an incoming character and transmits it. This is a very simple method of fully testing the RS232 communication (PIC software, PIC, MAX232, cable, and wiring). The DOS based test program (test.exe, version 1.05) was used to carryout two separate tests. The first used the TX terminal to transmit a message, then the RX terminal is used to receive the message, if the RX & TX messages are identical the test is successful. The second used the loop back test function of the test program; this stresses the communications as a large amount of data is transmitted and compared with the received block of data.
 
The TX/RX terminal tests were successful for all baud rates, but the loop back tests failed at high baud rates. There are two possible reasons for this; the first is that because a large block of data is being transmitted through unshielded cable, clearly there is a good chance of an error occurring at high baud rates. The second possibility is that the PIC UART input buffer overflowed.
 
 

 
11.2.3. Test 6: Test ADC, Scope Program and Real-time Communication Protocol
 
Program mark6.c was compiled and loaded into PIC using Microchip MPLAB, basically it reads the DIP switches and sets the baud rate, then it reads the ADC CH1 (AN0), and transmits the result through RS232 using the real-time frame format, every 1ms (sample rate of 1000Hz). The scope.exe (version 1.027a) program was used to display the real-time frames graphically, and a calibrated digital signal generator was use to generate a 0 to 5V (e.g. 5V peak to peak with a DC offset of 2.5V) sinewave at a variable frequency (e.g. 2Hz, 5Hz, 10Hz, etc…).
 
Note: Sample rate = 1000Hz, 10 horizontal samples per division. Hence scope time-base is 0.01 seconds per division that’s 100Hz, note: time-base is fixed on this version of the scope program and was set to 115Kbaud.
 
2.5Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3a (high resolution 800 x 160, that’s 80 x 16 divisions), 40 division per cycle, hence the calculated frequency of the waveform is 1/(40 * 0.01) = 2.5Hz.
 
Figure 11.2.3a. Screen dump of scope program (sample rate = 1,000Hz, input wave = 2.5Hz sinewave 0-5V)
 
5Hz sine-wave (0-5V) connected to CH1/AN0, see figure 11.2.3b (resolution 200 x 160, that’s 20 x 16 divisions), 19 division per cycle, hence the calculated frequency of the waveform is 1/(19 * 0.01) = 5.26Hz.
 
Figure 11.2.3b. Screen dump of scope program (sample rate = 1,000Hz, input wave = 5Hz sinewave 0-5V)
 
10Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3c (resolution 200 x 160, that’s 20 x 16 divisions), 10 division per cycle, hence the calculated frequency of the waveform is 1/(10 * 0.01) = 10Hz.
 
Figure 11.2.3c. Screen dump of scope program (sample rate = 1,000Hz, input wave = 10Hz sinewave 0-5V)
 
20Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3d (resolution 200 x 160, that’s 20 x 16 divisions), 5 division per cycle, hence the calculated frequency of the waveform is 1/(5 * 0.01) = 20Hz.
 
 
Figure 11.2.3d. Screen dump of scope program (sample rate = 1,000Hz, input wave = 20Hz sinewave 0-5V)
 
50Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3e (resolution 200 x 160, that’s 20 x 16 divisions), 2 division per cycle, hence the calculated frequency of the waveform is 1/(2 * 0.01) = 50Hz.
 
Figure 11.2.3e. Screen dump of scope program (sample rate = 1,000Hz, input wave = 50Hz sinewave 0-5V)
 
100Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3f (resolution 100 x 80, that’s 10 x 8 divisions), 1 division per cycle, hence the calculated frequency of the waveform is 1/(1 * 0.01) = 100Hz.
 
Figure 11.2.3f. Screen dump of scope program (sample rate = 1,000Hz, input wave = 100Hz sinewave 0-5V)
 
200Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3g (resolution 100 x 80, that’s 10 x 8 divisions), 0.5 divisions per cycle, hence the calculated frequency of this waveform is 1/(0.5 * 0.01) = 200Hz. But waveform is under sampled and heavily distorted, recall that the pulse interpolator display type (scope.exe uses this) requires at least 10 sample / cycle before a recognisable sine-wave can be plotted.
 
Figure 11.2.3g. Screen dump of scope program (sample rate = 1,000Hz, input wave = 200Hz sinewave 0-5V)
 
500Hz sine-wave (0-5V) connected to CH1/AN0, see figure 11.2.3h (resolution 100 x 80, that’s 10 x 8 divisions), something real strange has happened here, clearly the result of under sampling.
 
Figure 11.2.3h. Screen dump of scope program (sample rate = 1,000Hz, input wave = 500Hz sinewave 0-5V)
 
 
11.2.3.1. Sample Rate Changed to 2000Hz (mark6b.c)
 
Scope time-base is 0.005 seconds per division that’s 200Hz.
 
10Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3.1a (resolution 200 x 160, that’s 20 x 16 divisions), 19.5 division per cycle, hence the calculated frequency of the waveform is 1/(19.5 * 0.005) = 10.25Hz.
 
Figure 11.2.3.1a. Screen dump of scope program (sample rate = 2,000Hz, input wave = 10Hz sinewave 0-5V)
20Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3.1b (resolution 200 x 160, that’s 20 x 16 divisions), 9.7 division per cycle, hence the calculated frequency of the waveform is 1/(9.7 * 0.005) = 20.6Hz.
 
Figure 11.2.3.1b. Screen dump of scope program (sample rate = 2,000Hz, input wave = 20Hz sinewave 0-5V)
 
50Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3.1c (resolution 200 x 160, that’s 20 x 16 divisions), 3.9 division per cycle, hence the calculated frequency of the waveform is 1/(3.9 * 0.005) = 51.3Hz.
 
Figure 11.2.3.1c. Screen dump of scope program (sample rate = 2,000Hz, input wave = 50Hz sinewave 0-5V)
 
100Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3.1d (resolution 200 x 160, that’s 20 x 16 divisions), 1.95 division per cycle, hence the calculated frequency of the waveform is 1/(1.95 * 0.005) = 102.5Hz.
 
Figure 11.2.3.1d. Screen dump of scope program (sample rate = 2,000Hz, input wave = 100Hz sinewave 0-5V)
 
200Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3.1e (resolution 100 x 80, that’s 10 x 8 divisions), 0.975 division per cycle, hence the calculated frequency of the waveform is 1/(0.975 * 0.005) = 205Hz.
 
Figure 11.2.3.1f. Screen dump of scope program (sample rate = 2,000Hz, input wave = 200Hz sinewave 0-5V)
 
500Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3.1g (resolution 100 x 80, that’s 10 x 8 divisions), clearly under sampled.
 
Figure 11.2.3.1g. Screen dump of scope program (sample rate = 2,000Hz, input wave = 500Hz sinewave 0-5V)
 
1,000Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3.1h (resolution 100 x 80, that’s 10 x 8 divisions), something real strange has happened here, clearly the result of under sampling.
 
Figure 11.2.3.1h. Screen dump of scope program (sample rate = 2,000Hz, input wave = 1,00Hz sinewave 0-5V)
 
20Hz trianglewave (0-5V) connected to CH1/AN0, see figure 11.2.3.1i (resolution 200 x 160, that’s 20 x 16 divisions), 9.9 division per cycle, hence the calculated frequency of the waveform is 1/(9.9 * 0.005) = 20.2Hz.
Figure 11.2.3.1i. Screen dump of scope program (sample rate = 2,000Hz, input wave = 20Hz trianglewave 0-5V)
 
20Hz squarewave (0-5V) connected to CH1/AN0, see figure 11.2.3.1j (resolution 200 x 160, that’s 20 x 16 divisions), 9.9 division per cycle, hence the calculated frequency of the waveform is 1/(9.9 * 0.005) = 20.2Hz.
 
Figure 11.2.3.1j. Screen dump of scope program (sample rate = 2,000Hz, input wave = 20Hz squarewave 0-5V)
 
 
11.2.3.2. Sample rate changed to 5000Hz (mark6c.c)
 
Hence scope time-base is 0.002 seconds per division that’s 500Hz.
 
50Hz sinewave (0-5V) connected to CH1/AN0, see figure 11.2.3.2a (resolution 200 x 160, that’s 20 x 16 divisions), 8 division per cycle, hence the calculated frequency of the waveform is 1/(8 * 0.002) = 62.5Hz. Clearly something bad has happed here; there are gaps in the data. The reason for this is that the UART transmit buffer fills up and the program must wait until the transmit buffer is free to accepted another character; hence there is an additional time delay.
 
Figure 11.2.3.2a. Screen dump of scope program (sample rate = 5,000Hz, input wave = 50Hz squarewave 0-5V)
 
This program reads the ADC and transmits two characters with a 200µS delay before the process repeats over and over again. But if the transmits buffer is full, note that for 115kbps it takes 8.7µs (1/115,000) to transmit each character that’s 86.9µS per byte. Using the PICs built in timers should fix this problem.
 
But the main reason for the distorted waveform was because the PC serial buffer was overflowing. The incoming characters were coming in faster than the scope program was processing them hence the buffer was overflowing, causing gaps to appear in the data. The solution is to increase the scope programs communication protocol real-time timer (e.g. from 100ms to 25ms), and increase the buffer size (from 1k to 10k).
 
 

 
11.2.4. Test 7: Test Timer Interrupts.
 
Program mark7.c was compiled and loaded into the PIC using Microchip MPLAB. This program is simple, basically it setups all of the PIC onboard timers to interrupt the main program at preset timer intervals, then “Main…” is transmitted once every second forever. Timer 0 interrupt is used to transmit “Interrupt_T0” twice a second, timer 1 interrupt is used to transmit “Interrupt_T1” 4-times a second and timer 2 interrupt is used to transmit “Interrupt_T2” 10-times a second. The DOS based test program (test.exe, version 1.05) was used in the RX terminal mode to receive incoming characters. This test fully tests the timer interrupts, which will be used for time base, communications etc…
 
Screen dump of text.exe after a couple of seconds: -
Waiting for message (press a key to stop)
Main...Interrupt_T2...Interrupt_T2...Interrupt_T1...Interrupt_T2...Interrupt_T2.
..Interrupt_T2...Interrupt_T0...Interrupt_T1...Interrupt_T2...Interrupt_T2...Int
errupt_T2...Interrupt_T1...Interrupt_T2...Interrupt_T2...Interrupt_T0...Interrup
t_T1...Interrupt_T2...Main...Interrupt_T2...Interrupt_T2...Interrupt_T1...Interr
upt_T2...Interrupt_T2...Interrupt_T2...Interrupt_T0...Interrupt_T1...Interrupt_T
2...Interrupt_T2...Interrupt_T2...Interrupt_T1...Interrupt_T2...Interrupt_T2...I
nterrupt_T0...Interrupt_T1...Interrupt_T2...Main...Interrupt_T2...Interrupt_T2..
.Interrupt_T1...Interrupt_T2...Interrupt_T2...Interrupt_T2...Interrupt_T0...Inte
rrupt_T1...Interrupt_T2...Interrupt_T2...Interrupt_T1...Interrupt_T2...Interrupt
_T2...Interrupt_T2...Interrupt_T0...Interrupt_T1...Interrupt_T2...Main...Interru
pt_T2...Interrupt_T2...Interrupt_T1...Interrupt_T2...Interrupt_T2...Interrupt_T2
...Interrupt_T0...Interrupt_T1...Interrupt_T2...Interrupt_T2...Interrupt_T1...In
terrupt_T2...Interrupt_T2...Interrupt_T2...Interrupt_T0...Interrupt_T1...Interru
pt_T2...Interrupt_T2...Main...Interrupt_T2...Interrupt_T1...Interrupt_T2...Inter
rupt_T2...Interrupt_T0...Interrupt_T1...Interrupt_T2...Interrupt_T2...Interrupt_
T2...Interrupt_T1...Interrupt_T2...Interrupt_T2...Interrupt_T2...Interrupt_T0...
Interrupt_T1...Interrupt_T2...Interrupt_T2...Main...Interrupt_T1...Interrupt_T2.
..Interrupt_T2...Interrupt_T2...Interrupt_T0...Interrupt_T1...Interrupt_T2...Int
errupt_T2...Interrupt_T2...Interrupt_T1...Interrupt_T2...Interrupt_T2...Interrup
t_T2...Interrupt_T0...Interrupt_T1...Interrupt_T2...Interrupt_T2...Interrupt_T1.
..Main...Interrupt_T2...Interrupt_T2...Interrupt_T2...Interrupt_T0...Interrupt_T
1...Interrupt_T2...Interrupt_T2...Interrupt_T2...Interrupt_T1...Interrupt_T2...I
nterrupt_T2...Interrupt_T0...Interrupt_T1...Interrupt_T2...Interrupt_T2...Interr
upt_T2...
 
Clearly the timer interrupts are working, note that there were 11 “Interrupt_T2” between “Main…”, hence timing is slightly out (should be 10). Timer 1 and Timer 0 timing were correct, allow it is important to realise that the main program uses a loop delay, this delay does not take into account the delay taken to process the interrupt hence this may explain way timer 2 appear to be slightly out.
 

 
11.2.5. Conclusion
 
Clearly the four tests that were carried out were successful. Allow problems occurred when sampling at 5,000Hz (distorted waveform), clearly there are two main reason for this the first is that the UART transmit buffer fills up and the program must wait until the transmit buffer is free to accepted another character; hence there is an additional time delay. The second is that incoming characters were coming in faster than the scope program was processing them hence the buffer was overflowing, causing gaps to appear in the data. The solution of both is simple; to solve the first problem one of the PICs real-time timers can be used for the time-base, hence any delay caused by the UART will not affect the time-base (timer will continue to count). The second problem can easily be solved by making the scope program read the serial port faster, and increasing its buffer.
 
 


Part B
 

Final Year Project

Content Page

Colin's Home Page


This Web Page was last updated on Friday June 28, 2002


Home    About me    National Record Of Achievement    Hobbies / Interests   Guest Book    Contact Me    Links    Snooker   Amateur Radio    Site Map


© 2002 Designed by Colin K McCord


This website is best viewed by Microsoft Internet Explorer 6.0 at a resolution of 1024 x 768