Professional Documents
Culture Documents
HEAD to TOE
Examples Guide PTK40A
PTK40A
PIC16F EXAMPLES GUIDE
V1.3
Sep 2014
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
Index
1. Introduction
2. Getting Started
10
12
13
3.
Examples:
14
3.2 BUZZER
15
3.3 7-Segment: 00 to 99
16
17
18
19
20
21
22
24
26
28
30
32
34
35
37
38
39
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
41
43
45
49
3.24 Using SD02B from PTK40A via normal digital output pin (JP26)
52
54
3.26 Using MD10C from PTK40A via normal digital output pin (JP27)
57
59
63
5. Conclusion
65
66
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
1. INTRODUCTION
PTK40A Training Board is developed based on Microchip 8-bit 40 pins PIC MCU
(MicroController Unit). It is compatible between PIC16F and PIC18F. It covers
programming, interfacing, and applications of microcontroller and mechanical hardware to
help users in learning and developing their project with PIC MCU.
The systems hardware is well configured so that it can be programmed by any compatible
programming language such as assembly, BASIC and C (for PIC MCU). MPLAB IDE from
Microchip Technology .Inc is included in this kit which has assembler that enable user to
develop the program with assembly language. However, the explanation and sample
programs provided in the users manual are based on C language due to its relatively
flexibility and easiness in understand and developing program.
This document provides guidance to operate the examples code/applications.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
PTK40A LAYOUT
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
2.GETTING STARTED
2.1 The Power and Programmer
Please connect the power supply from adapter and the USB (mini) cable provided as shown
in the below picture, please make sure the PTK40A is being powered up.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
Or open it from MPLAB IDE Open Project icon, click on the icon shown in the picture:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
Please check the settings at: Programmer ->Settings (On MPLAB IDE Toolbar), ensure the
settings are same as picture shows.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
10
You can start editing the example program or compile it and load into PTK40A by clicking
the Build All icon as shown::
If the USB cable is connected correctly and PTK40A is powered up, the program will be
loaded into PTK40A and the output window in MPLAB IDE will show this:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
11
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
12
If the Programmer is connected and detected, import the HEX file from the desire example
folder.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
13
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
14
15
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
16
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
17
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
18
3. Examples
3.1 LED BLINKING
Jumpers Configuration
JUMPER
NUMBER
PIN NAME
CONDITION
Jumpers Section
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example1.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting up
the jumpers.
Additional Hardware:
None
Expected Result:
The LED of RD4 will keep blinking after the buzzer beep for once.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
19
3.2 BUZZER
Jumpers Configuration
JUMPER
NUMBER
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example2.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting up
the jumpers.
Additional Hardware:
None
Expected Result:
Press SW1,
SW2 to stop buzzer sound.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
20
3.3 7-Segment: 00 to 99
Jumpers Configuration
JUMPER
NUMBER
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example3.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting up
the jumpers.
Additional Hardware:
None
Expected Result:
7-segment will display value from 00 to 99 with increment of 1, and interval of 500ms.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
21
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example4.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting up
the jumpers.
Additional Hardware:
None
Expected Result:
After pressing SW1 the LCD will display Cytron PTK40A and Hello World.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
22
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example5.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting up
the jumpers.
Additional Hardware:
None
Expected Result:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
23
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
24
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example6.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting up
the jumpers.
Additional Hardware:
None
Expected Result:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
25
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
26
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
JP14
TEMP
CONNECT TO TEMPERATURE
Please load the Example7.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting up
the jumpers.
Additional Hardware:
None
Expected Result:
Temperature reading from LM35 is display on 7-segment. Touch the temperature sensor to
see the temperature changes.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
27
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
28
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
PWM
CONNECT TO PWM
JP20
DC MOTOR
CONNECT TO DC MOTOR
JP21
DC MOTOR
CONNECT TO DC MOTOR
JP14
POT
CONNECT TO POTENTIOMETER
Please load the Example8.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting up
the jumper
Additional Hardware:
None
Expected Result:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
29
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
30
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
PWM
PWM
JP14
POT
CONNECT TO
POTENTIOMETER
JP20
STEPPER
CONNECT TO STEPPER
MOTOR
JP21
STEPPER
CONNECT TO STEPPER
MOTOR
JP23
UNIPOLAR
STEPPER MOTOR IN
UNIPOLAR
JP24
UNIPOLAR
STEPPER MOTOR IN
UNIPOLAR
Please load the Example9.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting up
the jumpers.
Additional Hardware:
None
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
31
Expected Result:
The stepper motor rotation speed will based on the ADC value from potentiometer.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
32
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP9
SERVO
CONNECT TO SERVO
JP10
BUZZER
CONNECT TO BUZZER
JP14
POT
CONNECT TO
POTENTIOMETER
Please load the Example10.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumper.
Additional Hardware:
None
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
33
Expected Result:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
34
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
JP14
EXT
CONNECT TO ULTRASONIC
Please load the Example11.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
Ultrasonic sensor x 1, please refer to the datasheet for further details.
Ultrasonic Connection:
Ultrasonic Pin
GND
GND
+5V
5V
AN
IN
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
35
Expected Result:
Once the connections are done and example code is loaded into PTK40A, the distance
detected by Ultrasonic will be displayed on LCD.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
36
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
JP14
EXT
CONNECT TO IR SENSOR
Please load the Example12.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumper
Additional Hardware:
Sharp Analog Distance Sensor x 1, please refer to the datasheet for further
details.
IR Analog Distance Sensor Connection:
Vo
IN
GND
GND
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
37
Vcc
5V
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
38
Expected Result:
The LCD will display the result of the IR sensor, distance from IR sensor until obstacle.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
39
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
JP15
5V
CONNECT TO 5V
Please load the Example13.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
IR01A Sensor x 1, please refer the Users Manual for further detail.
IR01A connection:
IR01A Pin
V+
GND
IN
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
40
Expected Result:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
41
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
JP15
5V
CONNECT TO 5V
Please load the Example14.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
PIR Sensor
PIR sensor connection:
GND
OUT
IN
V+
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
42
Expected Result:
The LED at RD5 will active (ON) there is change in environment. The PIR sensor detect
infrared.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
43
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
PWM
CONNECT TO PWM
JP20
DC MOTOR
CONNECT TO DC MOTOR
JP21
DC MOTOR
CONNECT TO DC MOTOR
JP14
POT
CONNECT TO
POTENTIOMETER
Please load the Example15.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
None
Expected Result:
Turn the potentiometer to control the speed of motor and further display the RPM on LCD. If
the encoder is too sensitive please adjust the threshold for the encoder by turning the
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
44
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
PWM
CONNECT TO PWM
JP14
TEMP
CONNECT TO TEMPERATURE
SENSOR
JP20
DC MOTOR
CONNECTED TO DC MOTOR
JP21
DC MOTOR
CONNECTED TO DC MOTOR
Please load the Example16.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
UC00A or UC00B
Connection:
Please refer to Using HyperTerminal to setup the necessary connection and COM port. .
Connect UC00A or UC00B to PTK40A UART pin. Please refer to respective Users Manual
for details, UC00A Users Manual, UC00B Users Manual. This example will use UC00A.
UC00A/B
RX
TX
TX
RX
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
45
GND
Expected Result:
The brush motor will turn according to the key pressed from computer keyboard.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
46
While you control the motor from keyboard, PTK40A will also send temperature update to
HyperTerminal.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
47
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example17.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
None
Expected Result:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
48
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP3
I2C
CONNECT TO I2C
JP5
I2C
CONNECT TO I2C
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example18.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
None
Expected Result:
The LCD will display the seconds, minutes, hours, date, month and year as shown.
To configure the clock information:
SW1 = choose mode
SW2 = increase the value
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
49
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP9
SERVO
CONNECT TO SERVO
JP10
PWM
CONNECT TO PWM
JP20
DC MOTOR
CONNECT TO DC MOTOR
JP21
DC MOTOR
CONNECT TO DC MOTOR
Please load the Example19.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
SKPS, please refer to SKPS Users Manual for further information.
PS2 controller
Connection:
Connect the SKPS with PS2 controller to dedicated slot on PTK40A as shown. Please ensure
the pin is connected correctly and properly as wrong connection will most probably
damage the SKPS.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
50
Expected Result:
Push the knob up,down,left and right of the both joystick to see the result at servo and DC
motor.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
51
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section))
JP10
BUZZER
CONNECT TO BUZZER
JP14
TEMP
CONNECT TO TEMPERATURE
Please load the Example20.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
Xbee Starter Kit x 2 units, please refer to SKXBee Users Manual for further
information.
Setup of SKXBee with X-CTU, please refer to this tutorial.
Red circle part is to pairing the XBee and PanID must same
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
52
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
53
SKXBee Connection:
Please connect one of the SKXBee on PTK40A as shown, please ensure the connection is
correct and proper to avoid any damage. Another SKXBee connect to computer via USB
cable as shown.
Expected Result:
Reading from temperature sensor will shown in X-CTU and motor will turn if pressed key
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
54
from the keyboard for motor speed, slow speed from 1, and increase until 9.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
55
PIN NAME
CONDITION
LOCATION NUMBER
(refer Jumpers Section)
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example21.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware :
BlueBee x1, please refer to BlueBee Users Manual for further details.
Bluetooth USB doggle x1
To setup the Bluetooth connection, please refer to here.
Connection:
Please connect the USB Bluetooth Dongle to any available USB port on computer or laptop.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
56
Please connect the BlueBee module on SKXBee further connect it onto PTK40A as shown.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
57
Expected Result:
After Bluetooth SPP (Serial Port Profile) link is created and HyperTerminal is setup, please
press the Reset button on PTK40A.
HyperTerminal will show the message to request for value from keyboard.
The number (only number value) pressed on computer keyboard will be displayed on 7segment, PTK40A.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
58
PIN NAME
CONDITION
LOCATION NUMBER
(refer location chart above)
JP10
BUZZER
CONNECT TO BUZZER
JP15
5V
Please load the Example22.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
Low cost infrared sensor x 1, please refer to the Users Manual for further
details.
Connection:
Please connect the digital sensor to External Digital Port of PTK40A as shown.
Digital Sensor Pin
Brown (Vcc)
V+
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
59
Blue (Ground)
GND
IN
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
60
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
61
Expected Result:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
62
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
63
PIN NAME
CONDITION
LOCATION NUMBER
(refer location chart above)
JP7
RELAY
CONNECT TO RELAY
JP10
BUZZER
CONNECT TO BUZZER
Please load the Example23.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
Magnetic Door Lock x 1
Connection:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
64
When switch on the power, the magnetic lock is activated and you need to key in 6 digit
password.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
65
If wrong password is key-in, Error message will appear and the program restart in 3 second.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
66
If correct password is correct, SUCCESS will appear on LCD and the lock release the metal.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
67
3.24 Using SD02B from PTK40A via normal digital output pin (JP26)
Jumpers Configuration
JUMPER
NUMBER
PIN NAME
CONDITION
LOCATION NUMBER
(refer location chart above)
JP10
PWM
CONNECT TO PWM
Please load the Example24.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware :
SD02B x1, please refer to SD02B Users Manual for further information.
STEPPER MOTOR x1
Connection:
Please connect the Stepper motor according to SD02B Users Manual. Further connect
SD02B to PTK40A Stepper port as shown in above diagram. Move the jumper on SD02B
to Vmotor.
SD02B
Vmotor
VIN
GND
GND
PULSE
PULSE
DIR
DIR
EN
EN
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
68
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
69
Expected Result:
Follow the instructions on LCD. SW1 to increase speed while SW2 to decrease speed. SW3
will activate/deactivate the turning of Stepper motor. SD02B have default step to
microstepping of 10:1, so it might be very slow, try to increase speed to maximum.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
70
JP10
PIN NAME
CONDITION
LOCATION NUMBER
(refer location chart above)
BUZZER
CONNECT TO BUZZER
Please load the Example25.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
SD02B x1, please refer to the Users Manual for further information.
STEPPER MOTOR x1
Connection:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
71
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
72
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
73
Expected Result:
SW1 and SW 2 is to change direction, SW3 is for active or deactivate the SD02B.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
74
3.26 Using MD10C from PTK40A via normal digital output pin (JP27)
Jumpers Configuration
JUMPER NUMBER
JP10
PIN NAME
CONDITION
LOCATION NUMBER
(refer location chart above)
PWM
CONNECT TO PWM
Please load the Example26.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
DC Brushed Motor x 1
MD10C x1, please refer to the Users Manual for further details.
Connection:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
75
MD10C connection
VIN
VIN
DIR
CW
PWM
PWM
GND
GND
76
Expected Result:
The DC brush motor will rotate in a direction when SW1 is pressed, while in another
direction when SW2 is pressed.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
77
JP10
PIN NAME
CONDITION
LOCATION NUMBER
(refer location chart above)
PWM
CONNECT TO PWM
Please load the Example27.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware :
DC Brushed Motor x 1
MD10C x1, please refer to the Users Manual for further details.
Connection:
Full connection
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
78
MD01C Connection
PTK40A Connection
MD10C
VIN
VIN
DIR
PWM
PWM
CCW
GND
GND
Expected result:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
79
80
The DC brush motor will rotate in a direction when SW1 is pressed, while in another
direction when SW2 is pressed.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
81
3.28 reserve
Jumpers Configuration
JUMPER
NUMBER
PIN NAME
CONDITION
LOCATION NUMBER
(refer location chart above)
JP3
I2C
NOT APPLICABLE
JP5
I2C
NOT APPLICABLE
JP6
SPI
NOT APPLICABLE
JP7
SPI
NOT APPLICABLE
JP9
SK_RST
NOT APPLICABLE
JP10
BUZZER
CONNECT TO BUZZER
JP14
POT
NOT APPLICABLE
JP15
5V
NOT APPLICABLE
JP18
OUT
NOT CONNECTED
JP20
STEPPER
NOT APPLICABLE
JP21
STEPPER
NOT APPLICABLE
JP23
UNIPOLAR
NOT APPLICABLE
JP24
UNIPOLAR
NOT APPLICABLE
Please load the Example 22.hex (Using MPLAB IDE or PICkit 2 Programmer) after setting
up the jumpers.
Additional Hardware:
DC Brushed Motor x 1
MD10C x1, please refer to the Users Manual for further details.
Connection:
Expected Result:
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
82
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
83
Thats all.
4.2 PICkit 2 not detected or error message
Connection and power of PTK40A might sometime lead to problem to load program. So
when you see the PICkit2 cannot get the ID of the PTK40A, please check weather the power
of PTK40A is activated and the USB cable is connected properly.
If problem still occur please check weather the setting is correct according to above setting.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
84
5. CONCLUSION
Examples provided for PTK40A is aiming as references, not as a complete project. Please
feel free to modify it and suite it to your own purpose.
If you have any inquiry/problem, please do discuss in our technical forum. We prefer to have
a good learning and sharing environment where public may contribute and benefit from the
discussion, an open forum provide that.
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
85
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
86
Prepared by
Cytron Technologies Sdn. Bhd.
No. 16, Jalan Industri Ringan Permatang Tinggi 2,
Kawasan Industri Ringan Permatang Tinggi,
14100 Simpang Ampat,
Penang, Malaysia.
Tel:
Fax:
+604-504 1878
+604-504 0138
URL: www.cytron.com.my
Email: support@cytron.com.my
sales@cytron.com.my
Back to Index
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved
87