All of the lab exercises refer to supplementary files or ZIP archives;
these are found below.
- Experiment 1, Student ID CPU, ZIP archive ,
FAQ .
- Experiment 2, PIC18, MPLAB Intr , FAQ .
- mptst.asm
- shownum.asm
- Experiment 3, PIC assembly language programming #1, FAQ ,
Compiling these files with
Visual Studio 6.0 or Visual C .NET.
- op.zip archive
- loop.zip archive
- Experiment 4, PIC assembly language programming #2
- intop.zip archive
- compare.zip archive
- Experiment 5, PIC assembly language programming #3, FAQ .
- strlcase.asm
- strflip.c
- strup.c
- strxchg.c
- strcnt.c
- cstrcnt.c
- Experiment 6, PIC Startup, FAQ .
- Prototyping Walkthru for PIC
Startup Schematic , supplements the instructions in the lab
manual with a step-by-step connection diagram of the startup
schematic.
- Changing PIC18 configuration bit settings using the COLT Bootloader
instead of JOLT, see this document if you the COLT bootloader
instead of JOLT.
- config.h (needed by all files)
- delay.h (DelayMS, DelayUs)
- ledflash.c
- ledflash.hex (HSPLL)
- ledflash_a200.hex (HSPLL)
- serial.c (needed by most files)
- echo.c
- echo.hex (HSPLL)
- echo_a200.hex (HSPLL)
- reset.c
- Experiment 7, Serial vs. Parallel IO, FAQ .
- serio.c (putch/getch subroutines)
- ledsw1 (LED/Switch IO example)
- Experiment 8, Interrupt-driven IO
- root_rxfifo.c
- rxfifo_test1.txt
- intfsm.c , a fairly
simple LED/Switch IO, ISR only looks for falling edges on pushbutton
input.
- intfsm_new.c , a more
complex example, ISR looks for both falling and rising edges by
changing the active interrupt edge between states. See Interrupt
notes for state chart.
- Experiment 9, The I2C Bus, FAQ .
- i2cmsu.c
- i2cmsu.h
- i2c_memutil.c
- i2cmemtst.c
- Experiment 10, Data Conversion, FAQ .
- dactst.c
- Experiment 11, Timers #1
- sqwave.c
- mtrpwm.c
- pcmgen.c
- Experiment 12, Timers #2
Careful: The IR detector is sensitive to noise, which can cause it
to emit pulses with no IR source present. Use the scope to ensure that
your IR receiver is not doing this. If this happens, try
isolating the noise source by unplugging chips from the board until
the errant pulses disappear. In the past, it was found that an LM386
with an OPEN input pin (pin 3) caused this problem. Removing the LM386
or grounding the input caused the problem to disappear.
I have also had this noise problem occur if I did not have a decoupling
capacitors (0.1 uF capacitors) placed between Vdd and GND on the PIC18
(put this as close as possible to the chip as you can).
- swdetov.c Measures
pulse-width
Either this file or the next file can be used as a
starting point for decoding IR space-width data.
- irdet_biphase.c
Biphase IR decode example from textbook. If you want to try this code
on your PIC18 board, the
Radio Shack Universal remote control must be programmed for a
Phillips VCR, which is manufacturer code 333. This code can be used
as a starting point for your space-width decoding code. This is only a
suggestion, you do not have to use this code as a starting point. Warning:
Biphase decoding is more complex than space-width decoding; this code
decodes biphase by detecting both falling and rising edges on the IR
input waveform. Space-width decoding only requires that you detect
every falling edge since you are trying to detect the difference
between successive bit periods. If you use this code as a starting point, you will
be simplifying its operation, and you will have to understand
how the original code works order to know what to remove.
- Experiment 13, Audio Record/Playback
- audio.c
- ZIP archive with some WAV
files
CAUTION: If you do not have input A2 of the 24LC515 (Serial EEPROM)
tied to VDD then when your writes get to the 2nd block of EEPROM,
they will fail (you will get a watchdog timeout error because the
device will not respond).