SK40C TUTORIAL
SK40C + PIC16F887
STARTER KIT MANUAL
BEGINNER GUIDE
————————————————————————————————————————————————————————-

SK40C is another enhanced version of 40 pins PIC microcontroller start up kit. It is designed to offer an easy-to-start solution for PIC MCU user. Users are able to utilize the function of PIC by directly plugging in the I/O components in whatever way that is convenient to them. With UIC00B connector on board, user can start developing projects and have fun with this kit right away. This kit comes WITHOUT PIC microcontroller to provide the freedom for user to choose PIC model.
Here , we are going to explain to you the method of using SK40C with PIC16F887 by interfacing with others common use electronic components such as sensor, LED, UART, PS2 controller and etc. There is total of 15 interesting project from Project_0 to Project_15 which have explain the method to use SK40C with PIC16F887 interfacing with electronic component.
This will help user on deeply and easily understanding the function of SK40C, microcontroller and also HI-TECH C programming.
SK40C board comes with basic element for user to begin project development. It offer plug and use features.
Here , we are going to explain to you the method of using SK40C with PIC16F887 by interfacing with others common use electronic components such as sensor, LED, UART, PS2 controller and etc. There is total of 15 interesting project from Project_0 to Project_15 which have explain the method to use SK40C with PIC16F887 interfacing with electronic component.
HOW TO USE IT
This starter kit manual are start off with a simple introduction of SK40C, software installation, electronic component needed and interfacing, hardware, some useful additional information and lastly the C code explanation . We will also describe separately the code and also the hardware connection in some detail and how it works.
WHAT YOU WILL NEED
First, you will need access to internet and download the sample code of 15 interesting project and also any code libraries that is required in the projects.
Second, you will need to prepare the electronic component which will be use in the project such as LED, Ultrasonic sensor, UC00A and etc. Then you also need a well lit table or other surface to lay down all your components and this will be next to your computer for enable you to easily upload the code into the SK40C. Always beware that you are working with electricity (although is low voltage) but safety is a MUST to avoid damages on yourself and components.
Besides that, also of some benefit, although not essential, may be a pair of wire cutters, a pair of long nosed pliers and a wire stripper for making a jumper wires.
Lastly, the most important thing is the willingness to learn. Coming project are design as a simple way to help you get involve to the microcontroller electronics and nothing is too hard to learn.
PLEASE FEEL FREE TO SHARE….
To download the user manual, please click here.
To download the complete source code, please click here.
To download SK40C Cheat Sheet, click here.
————————————————————————————————————————————————————————-
Contents |
————————————————————————————————————————————————————————-
COMPONENT REQUIRED
————————————————————————————————————————————————————————-
WHAT EXACTLY INSIDE SK40C
BOARD OVERVIEW
SK40C, another enhanced version after SK40B which can support for 40 pins PIC such as PIC16F and PIC18F family. This board comes with basic element that mostly use by hobbyist and experts. This kit is design to offer:
- Industrial grade PCB
- Every board is being fully tested before shipped to customer
- Compact, powerful, flexible and robust start-up platform
- Suitable for hobbyists and experts
- Save development and soldering time
- No extra components required for the PIC to function
- All 33 I/O pins are nicely labeled to avoid miss-connection by users
- Connector for UIC00A (low cost USB ICSP PIC Programmer) – simple and fast method to load program
- Fully compatible with SK40B
- No more frustrated work plugging PIC out and back for re-programming
- Perfectly fit for 40 pins 16F and PIC18F PIC
- With UIC00A, program can be loaded in less than 5 seconds
- More convenient to use and it is smaller than SK40B.
- Maximum current is 0.5A.
- Dimension: 85mm x 55mm
SK40C come with additional features:
- 2 x Programmable switch
- 2 x LED indicator
- Turn pin for crystal. User may use others crystal provided.
- LCD display (optional)
- UART communication
- USB on board.
- And all the necessities to eliminate users difficulty in using PIC.
A – DC power adapter socket for user to plug in DC adapter. The input voltage should be range 7 – 15V.
B – USB connector for communication between devices and a host controller. This function only valid for certain model of PIC microcontroller. Please refer to SK40C User Manual. The power LED will light ON when USB cable is connected.
C – Toggle switch to ON/OFF the power supply from DC adapter.
D – Power indicator LED for on board. It will light ON as long as the input power is correctly connected.
E – 2×5 box header for UIC00A & UIC00B, USB ISCP Programmer.
F – 2 LEDs (connected to RB6 and RB7) as active High output for PIC MCU. These LEDs are controllable from PIC MCU.
G – Consist of several line of header pin and turn pin. Header pin provide connector for user to solder SK40C to prototype board and use the I/O of PIC MCU. It is fully compatible between SK40B. Turn pin offer simple way to check voltage with multi-meter probe. 40 pins of PIC MCU excerpt OSC ( connected to crystal) are extended out to there pin. There is an extra pin on top of MCLR which is labeled as Vin, is connected to the input power.
H – 2x Push Button connected to RB0 and RB1 of PIC MCU. This is extra input button for user. It can be programmed as input switch.
I – Reserved for UART communication. Tx and Rx pin of SK40C are connected to RC6 and RC7 respectively. Ensure PIC use have the correct UART pin (RC6 and RC7).
J – Push button with the function of reset for PIC MCU.
K – 5K of trimmer to set LCD contrast.
L – JP8 is provided for LCD backlight. LCD Display will have backlight if this pin is shorted.
M – JP9 is provided for USB. Connect this pin is user use USB port.
N – 40 pin IC socket for user to plug in any 40 pin PIC MCU(8Bit). It can be either 16F or 18F PIC. Of course the IC package should be PDIP. Please ensure the first pin is at the top side. Inside IC socket, there some electronic component, it include a 20MHz Crystal.
O – Turn pins is provided for crystal. 20MHz is default crystal provided in SK40C. However, the 20MHz crystal; can be removed and replace with other crystal. Just remove crystal and put other crystal on turn pin without soldering.
P – Reserved for 2 x 16 LCD Display. User may solder 2 x 16 LCD display at this space if want to use it.
2 X 16 Parallel LCD Display Connection Pin (Label P)

Turn Pin For Crystal (Label O)

Push Button Pin (Label I)

UART PIN (Label H)

————————————————————————————————————————————————————————-
GETTING STARTED
In this SK40C tutorial, we are going to use MPLAB with HI-TECH C compiler to compile and program to the PIC16F887. MPLAB can be supported to Window, MAC OS and LINUX. In here we are presume that you are using Window. Download the MPLAB IDE from download page.
MPLAB IDE & HITECH C PRO Installation
Please install MPLAB IDE and HI-TECH PICC Lite according to the following steps.
- Please double click on the Setup to install MPLAB V8.70.
- The Install Shield Wizard will pop out.
- After all the directions shown in the welcome note (as in following diagram) is done, please click Next> for next step.

- Please select I accept the terms of the license agreement if it is not selected in the diagram below, and click Next> after this.
- Please select Complete for the setup type to install all program features, and click Next> to next step.
- In the Choose Destination Location, user is recommended to use the default destination folder, which is C:\Program
Files\Microchip\ or user is also free to select the other destination folder by using the Browse… button to browse to the desired destination folder. After that, click Next> for next step. - Please select I accept the terms of the license agreement if it is not selected in the diagram below, and click Next> after this.

- Please select I accept the terms of the license agreement again for the window shown below, and click Next> after this.
- Please click Next> for the diagram below.
- Please wait for awhile for the installation process shown in diagram below.
- A window for Question will pop out, please click YES to proceed with installation of HI-TECH C.
- Please click Next to Install HI-TECH C.

- Please select I accept the terms of the license agreement if it is not selected in the diagram below, and click Next to Install HI-TECH C.
- Please click Next> to proceed.
- Please select Add to environment path if it is not selected in the diagram below, and click Next to proceed.

- Please wait for the installation process to be completed.
- Please click Finish after successfully installed the HI-TECH C.

- The installation of MPLAB V8.70a is completed. Please click Finish to exit. User may need to restart the computer just after the installation or restart later.
CREATE PROJECT
After finished install the MPLAB IDE, we are going to show you how to create a project using it. There is just a few simple step to follow on how to create it. Please follow the step below:
- Go to to MENU BAR and click Project > Project Wizard.

- Click Next> . On the Device menu, choose PIC16F887 because we are going to use this PIC MCU for coming project.
- Choose HI-TECH Universal Toolsuite in Active Toolsuite. A HI-TECH ANSI C Compiler will show up in the Toolsuite Content.

- After that, choose a destination where the project you create to be save as. And also the project name. After that, click NEXT>.
- In step 4, there are no existing file to be added so we can skip this step by just click NEXT>. After that, a project are created with the project name you added earlier.
PICKIT 2 SETUP
- Go to MENU BAR. Programmer> Select Programmer> PICkit 2.
- Again, go to Programmer> Setting.

- Please tick the box below.

OPEN PROJECT
There are only few simple step to open an project. 1st Open the project file. Then, double-click the project file with MPLAB logo. Example like figure below.

HARDWARE SETUP
To make the SK40C function, put the PIC16F887 into the IC Socket that have been provided. Make sure the PIC MCU is correctly installed in the SK40C board. The PIN 1 is just next to the little half moon shape or circle.


Next, connect the A-type USB to the computer using like picture below.
After that, plug in the USB(mini) to the UIC00B. The power supply indication green LED will ON.

Lastly, connect one side of programming cable to box header of UIC00B and the other side to box header of SK40C(Target device) to be program.

I/O PORT
I/O of microcontroller can be access through few method such as breadboard, extend jumper wire like picture below.

Extend I/O to another board using jumper wire.

————————————————————————————————————————————————————————-
PROJECT 0: MY 1st PIC PROJECT, LOAD A SIMPLE LED BLINK
In this project, we are going to do a simple LEDs blinking using the LEDs on SK40C. In here, we are using both of the LEDs and blink it like a police car.Besides on learning electronic parts, you will also learn about some coding in C using HI-TECH C in MPLAB. More…
————————————————————————————————————————————————————————-
PROJECT 1: LED BLINKING: LED CHASER
In project 1, you are about to experience how to program a LED chaser which can be increase the running speed by just a single button pushing. While releasing it, the running speed will slowly back to normal. In here, we are going to use total of 6 LEDs and will connected with a current limiting resistor before plug into the I/O port. More..
————————————————————————————————————————————————————————-
PROJECT 2:“Hello World” WITH PARALLEL LCD
For project 2, we will show you how to interface the SK40C board will parallel 16×2 LCD display. The connection are simple and the coding are easy to learn. We are going to display the “Hello World” on the LCD display by just adding a library that has been done for you. More..
————————————————————————————————————————————————————————-
PROJECT 3: DIGITAL INPUT: PUSH BUTTON
For this project, we will discover how to manage a digital input signal. As we know that digital signal is either HIGH (1) and LOW (0) only. But for different integrated circuit such as PIC MCU, we need to define at the beginning of the code that the port using are either input or output and also declaration for digital or analog signal send and received. More..
————————————————————————————————————————————————————————-
PROJECT 4: ANALOG SENSOR: POTENTIALMETER & BB-PSJ
In this part, we are going to discuss about how to write the Analog to Digital Converter code which has become the most popular question among the students. We are going to use PIC16F887 with have contain of 10-bits binary result and a potential-meter to adjust the voltage different and display it in the LCD display. More..
————————————————————————————————————————————————————————-
PROJECT 5: ANALOG SENSOR: TEMPERATURE USING LM35
Nowadays, there are many type of temperature sensor is come with different output form and also the temperature range such as thermocouple, thermistor, infrared, RTD. In here, we pick LM35 as our temperature sensor due to it have a linear output and also suitable for normal use like weather temperature measuring. More..
————————————————————————————————————————————————————————-
PROJECT 6: ANALOG SENSOR: RANGE USING ULTRASONIC RANGE FINDER
There are many sensor to measure a range such as using Ultrasonic, Infrared and more. In here, we are going to experience how to measure a range using Maxbotic Maxsonar-EZ1 ultrasonic range finder which it will give the output value in inch. More..
————————————————————————————————————————————————————————-
PROJECT 7: ANALOG SENSOR: RANGE USING ANALOG DISTANCE SENSOR
Analog distance sensor which have a function that same as the Ultrasonic sensor which is use to measure range. But for this sensor, the output value are in centimeter(cm) and also the output are only given an analog value. To get the result, an mathematics formula are required to apply into our C-code for calculation. More..
————————————————————————————————————————————————————————-
PROJECT 8: PIEZO BUZZER: MELODY – BIRTHDAY SONG
Piezo buzzer, generally use as a sensor and actuator which are use to measure force, pressure , tools for positioning object and etc. As for this project, we are going to use it to generate a melody by applying PWM frequency to it. More..
————————————————————————————————————————————————————————-
PROJECT 9: ANALOG SENSOR: LIGHT DETECTION USING LDR
A photoresistor or light dependent resistor (LDR) is a resistor whose resistance decreases with increasing incident light intensity. It can also be referred to as a photoconductor. In here, we going to do a simple connection of LDR and display the ADC and Voltage value on LCD. More..
————————————————————————————————————————————————————————-
PROJECT 10: DRIVING DC BRUSH MOTOR WITH MD10C
MD10C is an enhanced version of the MD10B which is designed to drive high current brushed DC motor up to 10A continuously. It offers several enhancements over the MD10B such as support for both locked-antiphase and sign-magnitude PWM signal as well as using full solid state components which result in faster response time and eliminate the wear and tear of the mechanical relay. More..
————————————————————————————————————————————————————————-
PROJECT 11: 7 SEGMENT DISPLAY WITH DIRECT I/O
Nowadays, 7 segment has become the most popular display unit on market because it is cheap, easy to program and small. On market, we can found that there was 2 types of 7 segment which is common anode and common cathode. In this project, we are going to use 7 segment with common cathode and directly interface to microcontroller. More..
————————————————————————————————————————————————————————-
PROJECT 12: 7 SEGMENT DISPLAY WITH CD4511 ENCODER
Besides on directly connected 7 segment with direct I/O port from microcontroller, we can also use the CD4511 (7 segment encoder) to help on decreasing the microcontroller I/O port and only required to send the binary data. More..
————————————————————————————————————————————————————————-
PROJECT 13: UART TO COMPUTER
Universal Asynchronous Receive/Transmit (UART) has becoming a popular item on sending and receiving data in the fast way. In here, we are going to experience on how to use UC00A to communicate with our computer/PC and SK40C. More..
————————————————————————————————————————————————————————-
PROJECT 14: INTERFACE WITH RELAY
Relay have become a common use electronic component which operate as an switching device by simply apply voltage to ON and OFF it. For this project, we will discover a simple relay connected with an LED to show what is the basic function and connection. More..
————————————————————————————————————————————————————————-
PROJECT 15:INTERFACE WITH SKPS
Play Station 2 (PS2) controller is relatively easy to obtain from any game store and it offers good human manual input for control system. More and more developers are looking into applying existing PS2 controller to control particular system. In here, we going to explore on how to interface PS2 controller with SK40C through SKPS controller starter kit. More..
————————————————————————————————————————————————————————-
Go to Project 0
————————————————————————————————————————————————————————-
ATTACHMENT:
1. User Manual.pdf
2. SK40C+PIC16F887 coding
3. SK40C Cheat Sheet
























With havin so much content and articles do you ever run into any issues of plagorism or copyright violation? My website has a lot of unique content I’ve either written myself or outsourced but it seems a lot of it is popping it up all over the internet without my authorization. Do you know any techniques to help protect against content from being stolen? I’d truly appreciate it.
Hi, we are not sure about that too. But it is fine for us as we like to share.
Hi,
I am having a problem compiling these tutorial projects. I am using MPLAB 8.3 and Hi-Tech Compiler 9.65 (Lite and PRO) but so far have only managed to compile PR2 and PR13. All the rest have the same error message which is related to the lcd.c code. The message is as follows:
Error [712] C:\…….\Project_15\lcd.c; 276. can’t generate code for this expression
Line 276 of the lcd.c file reads as follows:
unsigned int ui_decimal[5] ={ 0 };
Code snippet is as follows:
void lcd_bcd(unsigned char uc_digit, unsigned int ui_number)
{
unsigned int ui_decimal[5] ={ 0 };
//extract 5 single digit from ui_number
ui_decimal[4] = ui_number/10000; // obtain the largest single digit, digit4
ui_decimal[3] = ui_number%10000; // obtain the remainder
ui_decimal[2] = ui_decimal[3]%1000;
ui_decimal[3] = ui_decimal[3]/1000; // obtain the 2nd largest single digit, digit3
ui_decimal[1] = ui_decimal[2]%100;
ui_decimal[2] = ui_decimal[2]/100; // obtain the 3rd largest single digit, digit2
ui_decimal[0] = ui_decimal[1]%10; // obtain the smallest single digit, digit0
ui_decimal[1] = ui_decimal[1]/10; // obtain the 4th largest single digit, digit1
if (uc_digit > 5) uc_digit = 5; // limit to 5 digits only
for( ; uc_digit > 0; uc_digit–)
{
lcd_putchar(ui_decimal[uc_digit - 1] + 0×30);
}
}
There seems to be a problem with unsigned integers in the above code. I contacted Hi-Tech tech support and they said that the “can’t generate code” error message means there is a statement that is too complex for the compiler!
Please could someone at Cytron confirm that these projects have all been successfully compiled and if so what setup (MPLAB and Hi-Tech Compiler) they used?
Many thanks,
Dave Keogh
please give me the hex.file for obstacles avoidance robot,where PIC16F877A interface with DC motor and IR sensor(analog distance sensor)..
Hi Dave Keogh,
Please use the latest compiler. All these source code are compiled with Hi-tech v9.80. Any version newer than 9.80 should work. Thanks.
Hi Nabeel,
Please refer to PR23.