Showing posts with label in circuit serial programming. Show all posts
Showing posts with label in circuit serial programming. Show all posts

Monday, February 25, 2013

RGB LED software PWM fader using 12f675 - part 2

One of first program for learning microcontrollers is to blink a LED. This is considered as the "Hello World" version of hardware program. The basic concept is to make the pins as output and then make them high or low alternatively.

When you have learned the first program you would like move to more complex programming. A fader to fade-in and fade-out an LED would be a perfect next step. Here's the schematic to create a fader which uses a single RGB LED to create a rainbow effect for colors with a cheap PIC12F675 8 pin microcontroller.

Schematic

As you would have noticed that the circuit uses very few components. Now here is the flow chart for concept,
The program would start by setting up counters for all the LEDs and keep reducing the currently ON LED and increasing the counter for the next LED. While at the same time it switches on and off the LEDs based on the counter as delay. When the counter for current LED becomes zero it moves to the next LED.

Flowchart of the program,

Download the code in HITECH C from here.

This is how the it looks on the testboard.



Sunday, February 17, 2013

In Circuit Programming connection for PIC Microcontrollers

For the PIC Microcontrollers to function as per the program, the program needs to be loaded to its EEPROM. ICSP is the method which would enable the programming of the MC while in circuit, i.e., you do not have to remove the microcontroller from the circuit board to program it.

To program a microcontroller you would require a programmer (e.g., PICKIT2 or similar). It is a piece of hardware which can be connected to a computer with PICKIT2 programmer software or similar software through a serial or USB connection. The programmer has ICSP header pins which needs to be connected to PIC in the circuit which has to be programmed.


Following is the ICSP connection details to connect to different PIC microcontrollers.

Once the ICSP headers are connected to the PIC in circuit you can Write the program from the programmer software to the PIC.

More on programming the PIC in later posts...