Sponsers

Setting up Flowcode to work with your PICKit 2

If you’re a fan of Flowcode you probably enjoy the simpler things in life like I do.  If that’s true you’re really going to love how easy it is to get your PICKit 2 working with Flowcode.  Simply go to the top menu and select CHIP>Compiler Options…

Complier Options Menu

Read the rest of this entry »

Setting up Flowcode to work with your CHIPINO

In order to get your Flowcode to work with your CHIPINO you’ll need to make a couple of adjustments to the project options and Chip settings in Flowcode.  This is really easy to do and will only take a moment at the beginning of each project.  If you do what I do, you usually open an existing project and save it as a new one and your setup is already done.  But still, you need to do this the first time as well as know how to change the settings in the event you want a different chip in your CHIPINO.  Yes!  You can change out the chip that comes with it and exchange for another Microchip 28ld PDIP.   That’s one of the really cool things about working with both CHIPINO and Flowcode, everythings is pretty darn simple and flexible.

Read the rest of this entry »

PIC Timers

After writing about the PIC hardware PWM module it occurred to me that a little more information about the onboard timers would be in order. Just about every PIC has a timer and many have several. The PIC16F777 that we I used in the hardare PWM article has three of them called TMR0, TMR1, TM2

The three timers are similar to each other in many ways but are different in some respects. Below is a list of each of the timer features from the datasheet.

 

 

Read the rest of this entry »

Pulse Width Modulation (PWM) using the CCS Compiler

Pulse Width Modulation (PWM) signals in the embedded world are used all the time for a variety of reasons. One use is to communicate. For example, on most Ford cars and trucks the regulator communicates status of the alternator field coil back to the engine control module. If the duty cycle of the the PWM is between 10-90% it means that the alternator is working just fine and if it gets into the 0-10% or 90-100% there’s a problem. You could also control the power output of your headlights with PWM. This is how most daytime running lights are done. Some still switch into a resistor to knock down the power, but in todays world that’s just not efficient enough. We can also control the “theatre lighting” of our vehicle’s interior lights. Using PWM we can gradually brighten or darken the cars interior or we can take tricolor LEDs and change the color of our interior.

Read the rest of this entry »

Hello World for the PICKit 2

If you need a little help getting your PicKit 2TM LED’s to blink, here’s a little program that will get you started. You’ll see after you run it that I’ve toggled all 4 of the LED’s in two different sequences. You can play with the different outputs and durations to get familiar with how this is done in C. I’m using PICC Lite here so don’t forget to “include” the pic.h file into MPLABTM, otherwise it won’t work.
Read the rest of this entry »

LED Tutorial

As I was trying to think of a topic to write on this week, I noticed my ten year old son was playing on my bench trying to light up an LED with a battery. I was mildly entertained as he would smile when the light came on and then frown when it would turn off. “What happened?” he would say. I let him continue for a little while until I realized he was quickly working his way through my inventory of red LED’s.

 What my son didn’t realize is that he was either connecting them backwards and/or not properly limiting the current to the LED in which case he was burning them out. So yes, an idea on what to write about was born. As with most things that we set out to do, we need to understand the components that we’re working with. We don’t need to become an expert on LED’s to use one but some basic understanding is helpful.

Read the rest of this entry »