The first four lines are to tell the included PCW compiler what microchip I'm working with and how I've connected it to the computer.

The next line defines a constant variable named GREEN_LED that is equal to PIN_A5. A5 is the pin on the MCU that is connected to the green LED. This adds human readability to the program for turning on and off the LED.

in the main function there's a never ending loop that runs until the program is stopped.

Goals

Controlling a Video Camera With the PIC16F877A

The Goal

Low budget video and film makers have a hard time with getting full use of their art due to budgetary constraints. Cranes are quite expensive. The answer for the low budget film maker is to mount the camera on a pole and make the shot off of a monitor. The problem is that it's hard to control a camera when it's ten feet above the film maker's head. It's possible to use the LANC protocol to control the camera with a home made controller using the PIC16F877A MCU.

The Theory

The essential idea behind the MCU controlling the camera is that Sony developed the Control-L LANC protocol. It's a protocol that uses 3 pins for 2-way communication on a 9600 baud.

RS-232, which the MCU can communicate on, also uses 3 pins for 2 way communication on a 9600 baud.

The theory is that the protocols are similar enough that an RS-232 command from the MCU, can be received as a LANC command by the camera.

The Functionality

The PIC16F877A has 33 pins that can be used for input and output. A remote control for a car can be connected to these I/O pins to allow the MCU to translate those commands to RS-232 commands to send to the camera.

Networking Multiple PICs

The Goal

write a program that requires the PICs to communicate to one another. Because the prototype boards have Red, yellow, and Green lights, a traffic light program would work well.

The Theory

Because the PIC can communicate via RS232 they can be plugged into each other and communicate to one another.

The Functionality

The PIC currently displaying the green light would be in command, timing when it's time to change and passing control to the other PIC. The buttons on the board could be used as crossing signals, this would introduce interrupts.

Controlling other Electronics

The Goal

connect the PIC to Other electronics via SSRs.

The Theory

An SSR(Solid State Relay) acts as a switch. It can turn on a 110V device when it receives a 5V signal. The PIC's I/O pins are 5V+. This allows a program to turn on and off a device through the SSR

The Functionality

The kit came with a digital thermometer that can be used to determine a temperature on the PIC. A simple program would be a climate control device. If the temperature is above a programmed temperature turn on the SSR circuit connected to a fan, if it's below the programmed temperature turn on the SSR circuit connected to a heater (or blow dryer for the sake of the example). Using the included 2 digit 7-segment LEDs the programmed temperature could be displayed and added up and down buttons would allow us to change the programmed temperature.

Conclusion

I had nothing but trouble with the devices. I would get 2 steps into my project and something would break. I spent many hours, weeks and months with tech support, shipping parts back and forth. I'd get it working again and get 2 steps into the project just to once again have more problems. I really enjoyed working on this project and wish I could have written a useful program, and created a cool functioning device.