You are on page 1of 25

SK40B

PIC MICROCONTROLLER START-UP KIT

Users Manual
V1.2

August 2009
Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. No representation or warranty is given and no liability is assumed by Cytron Technologies Incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise. Use of Cytron Technologiess products as critical components in life support systems is not authorized except with express written approval by Cytron Technologies. No licenses are conveyed, implicitly or otherwise, under any intellectual property rights.

ROBOT . HEAD to TOE Product Users Manual SK40B

Index
1. Introduction and Overview 2. Packaging List 3. Board Layout 4. Product Specification 5. Installation (hardware) 5.1 Loading Program Using UIC00A Programmer 5.2 Loading Program Using Bootloader 5.2.1 Bootloader for 16F 5.2.2 Bootloader for 18F 2 3 4 6 7 7 8 9 17

6. Getting Started 7. Warranty Appendix A (schematic)

21 23 24

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B

1. INTRODUCTION AND OVERVIEW SK40B is enhanced version of SK40A. It is designed to offer an easy to start board for PIC MCU user. However, all interface and program should be developed by user. This board comes with basic element for user to begin project development. It offer plug and use features. This kit is designed 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 RS232 (Serial) hardware on board allowing alternative method to load program easily via bootloader Fully compatible with SK40A No more frustrated work plugging PIC out and back for re-programming Perfectly fit for 40 pins 16F and PIC18F PIC No more confusion between programmer and bootloader With UIC00A, program can be loaded in less than 5 seconds

SK40A come with:


5V voltage regulator (1A max) 20MHz crystal oscillator Reset button 1 x programmable push button RS232 hardware for serial communication to PC Connector for UIC00A On/Off switch for main power DC adaptor socket as power input And all the necessities to eliminate users difficulty in using PIC

Users are able to utilize the function of PIC by directly plugging in the I/O components in whatever way that is convenient to user. With UIC00A connector on board, user can start developing projects and have fun with this kit right away. Of course, bootloader can still be applied in loading program. This kit comes WITHOUT PIC microcontroller to provide the freedom for user to choose PIC type.

This document explains the method to use SK40B.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B

2. PACKAGING LIST Please check the parts and components according to the packing list. If there are any parts missing, please contact us at sales@cytron.com.my immediately.

1. 2. 3. 4. 5.

1 x SK40B board with all components shown soldered PIC MCU Not included, please purchase separately from Cytron website Serial Cable Not included, please purchase separately from Cytron website UIC00A Not included, please purchase separately from Cytron website User Manual Not included, please download from Cytron website

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B

3. BOARD LAYOUT

C E F D

Pin 1 of PIC

H I

Label A B C D E F

Function Slide Switch for main power supply DC power adaptor socket Battery connector Power indicator LED Serial cable adaptor (female DB9) Connector for UIC00A Programmer

Label G H I J K

Function 5V regulator Header pin and turn pin 40 pin IC socket for PIC MCU Reset button Programmable push button

A is a slide switch to On/Off the power supply from DC adaptor or Battery connector. Pushing the switch down will ON SK40B. B is a DC power adaptor socket for user to plug in DC adaptor. The input voltage should be ranged from 7 to 15V.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B

C is a 2510 2 way connector for battery input. The battery voltage should be between 7 to 15V. Please ensure the polarity of voltage is correctly plugged before power up SK40B. The + and -- is have been labeled at the side of connector. D is an indicator LED for on board 5V regulator. It will light ON as long as the input power is correctly connected and the slide switch is ON. E is a serial cable connector, female DB9. It should be connected to male DB9 serial cable. F is a 2x5 box header for UIC00A, USB ICSP PIC Programmer. G is a 5V voltage regulator H Consist of several line of header pin and turn pin. Header pin provide connector for user to solder SK40B to prototype board and use the I/O of PIC MCU. It is fully compatible between SK40A. Turn pin offer simple way to check voltage with multi-meter probe. 40 pins of PIC MCU except OSC (connected to crystal) are extended out to these pin. There is an extra pin on top of MCLR which is labeled as Vin, is connected to the input power. I 40 pin IC socket for user to plug in any 40 pin PIC MCU (8 bit). It can either be 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 electronics components, it include a 20MHz Crystal. J is a push button with the function of Reset for PIC MCU. K is a push button connected to RB0 of PIC MCU. This is an extra input button for user. It can be programmed as an input switch.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B

4. PRODUCT SPECIFICATION SK40B is designed to offer starting up platform for development, the specification of PIC MCU used should be referred. However, there is a limitation that user should beware of. The input supply should be from 7 to 15V. Battery or DC adaptor can be used. Note: Only 1 power supply should be provided to SK40B.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B

5. INSTALLATION (HARDWARE) SK40B come with UIC00A ICSP USB programmer connector and bootloader capability to offer simple way for downloading program. However, from user feedback and experience, using UIC00A ICSP programmer is very easy and save plenty of development time.

5.1 Loading Program Using UIC00A Programmer Connect SK40B as shown in following figure.

From UIC00A

After plug in 40 pin PIC MCU (make sure the orientation is correct), SK40B should be powered either from battery or DC adaptor. Now, the hex code is ready to be loaded to SK40B. For the usage of UIC00A, please refer to UIC00A Users Manual. RB7 and RB6 have been connected to UIC00A connector; both these pins are used for ICSP. User is advice not to use these pin as input. Even when using as output, RB7 or RB6 pin are recommended to be used in controlling non critical device such as LED, LCD, 7 segments or buzzer. It is recommended to isolated ICSP signals from application circuit by using series resistor (range 220 ohm and above). Furthermore, NO capacitance component (capacitor) should be connected to these 2 pins. Please refer to UIC00A Users Manual for further details.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B

5.2 Loading Program Using Bootloader Among the many features built into Microchips Enhanced FLASH Microcontroller devices is the capability of the program memory to self-program. This very useful feature has been deliberately included to give the user the ability to perform bootloading operations. Devices like the PIC16F877A or PIC18F452 family are designed with a designated boot block, a small section of protectable program memory allocated specifically for bootload firmware. Cytron Technologies have modified and applied bootloader firmware to PIC microcontroller which is ready to be used with simplest hardware interface. This user guide note demonstrates a very powerful bootloader usage for the PIC16F and PIC18F families of microcontrollers. The guide for 16F bootloader is different from 18F bootloader. Thus, there will be 2 sections to setup and use bootloader. In order to use bootloader function on SK40B, PIC microcontroller must have bootloader firmware preloaded. Please download the firmware from www.cytron.com.my and burn it to PIC microcontroller using programmer. Once your program is ready and a hex file is generated, you must now use bootloader to load your program into SK40B to run your program. Following description show the method in detail: Plug in the microcontroller at the socket. Make sure that it is in the correct position as the figure below. After plug in 40 pin PIC MCU with bootloader firmware (make sure the orientation is correct), SK40B should be powered either from battery or DC adaptor. Now, the hex code is ready to be loaded to SK40B. Since SK40B have bootloader hardware, 2 pins have been used for bootloader function. Pins that involved are: - RC7, used as RxD and connected to MAX232 - RC6, used as TxD and connected to MAX232 Connect serial port cable to computer and other end to serial cable adaptor on SK40B board.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B From PCs Serial Port

*CAUTION* The microcontroller should never be plug in the wrong position!

5.2.1 Bootloader for 16F Cytron Enterprises have developed a new bootloader firmware for 16F877A. Since 16F families have a wide range of microcontroller with plenty of memory size and configuration, this bootloader is created base on PIC16F877A. It has following features: a. Base on PIC16F877A, it should work for PIC listed below, however it have not been tested: i. PIC16F873A ii. PIC16F874A iii. PIC16F876A b. With bootloader firmware resized in PIC, user code must start from address 0x200. For assembly language, reset vector must start at address 0x200 while interrupt vector should start at 0x204.
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B

c. The configuration bits of new program code will be ignored as it cannot be accessed in bootloader mode. The configurations of bootloader firmware are listed. If configuration is need to be modified, please use programmer to do so. i. Oscillator = HS ii. Watchdog Timer = Off iii. Power Up Timer = On iv. Brown Out Detect = Off v. Low Voltage Program = Disabled vi. Flash Program Write = Write Protection Off vii. Data EE Read Protect = Off viii. Code Protect = Off For source code written in C language with PICC Lite Compiler, there must be offset 200 in the PICC Linker option (Please refer to the pictures below). Select Project Build Options Project

Specify the offset 200


Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

10

ROBOT . HEAD to TOE Product Users Manual SK40B

After generating hex code (with 0x200 offset) and setting up hardware connection, refer to the following steps for setting up and use HyperTerminal. 1. HyperTerminal is software available in all windows. 2. Open the HyperTerminal: Click Communications-> HyperTerminal Start-> All Programs-> Accessories->

3. Setting up the HyperTerminal (first time user): a) Once you entered HyperTerminal, key in any name under Name: and choose any icons. Example: Name: Bootloader. Click OK upon completion.

b) Choose connect using:COM1, then click OK.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

11

ROBOT . HEAD to TOE Product Users Manual SK40B

c) Choose the following details: Bits per second : 9600 Data bits :8 Parity : None Stop bit :1 Flow control : None After all the selection is completed, click OK.

d) Next, to change the character delay, select Properties-> Setting, go into ACSII Setup submenu. Change the character delay to 10 milliseconds. Please increase the time delay if the bootloader fail to load program completely.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

12

ROBOT . HEAD to TOE Product Users Manual SK40B

e) Then, save the file by selecting: File-> Save as. Key in the filename you prefer and press save.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

13

ROBOT . HEAD to TOE Product Users Manual SK40B

f) Close the HyperTerminal.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

14

ROBOT . HEAD to TOE Product Users Manual SK40B

g) Open the file that you have just saved. Click Start-> All Programs-> Accessories-> Communications-> HyperTerminal -> Bootloader.ht. You can always copy this shortcut to desktop.

4. For PIC microcontroller to enter boot mode and wait for hex file, press and hold down the Boot button then press the Reset button. Release the Reset button first, then release the Boot button. 5. Once the Reset buttons are released, the wording www.cytron.com.my will appear on the HyperTerminal screen.

6. Next is to transfer the Hex file to the PIC Microcontroller. Select Transfer-> Send Text File. Under Files of type, choose All files. Choose the Hex file that you want to transfer and click open.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

15

ROBOT . HEAD to TOE Product Users Manual SK40B

7. When transfer is successful, the wording Done! Reset PIC to run will appear on the screen. 8. Now you may reset the board by press and release the reset button.

9. To load program again, simply repeat step 4 to 8. If the loading is not completed, please check the connection, HyperTerminal setting and power.
Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

16

ROBOT . HEAD to TOE Product Users Manual SK40B

10. If bootloader firmware on PIC is corrupted, you will need to burn the firmware using programmer. In this case the bootloader will not work. Please download the hex code for PIC16F bootloader from Cytron website, the file name is 16F bootloader.hex.

2.5.2

Bootloader for 18F

After several feedbacks from customer, Cytron Technologies decided to use tinybootloader from Claudiu. This bootloader shows great stability and simplicity to use. Since 18F families have a wide range of microcontroller with plenty of memory size and configuration, this bootloader is created base on PIC18F452/252. It has following features: a. Only 100 bytes of bootloader firmware. b. No more pressing boot button to enter boot mode, it will wait 1 second after reset. c. No changes on linker file for those using c compiler. d. Developed for PIC18F458/258/452/252, it should work for PIC listed below, however it have not been tested: i. ii. iii. iv. v. vi. PIC18F242 PIC18F458 PIC18F258 PIC18F442 PIC18F248 PIC18F448

e. For this version of bootloader, user needs to ensure that the GOTO must be in the first 4 words of program. In other words, no more offset of program memory is required. Please start your program at ORG 0x000 for assembly language. For C compiler, no modification should be done on the linker file. f. Although PIC Tiny Bootloader is able to write configuration bits and EEPROM, it requires extra command to do so. Thus it is advice for user not to load the configuration bits and use the configuration on the original firmware. The original configuration for the source code are: i. ii. iii. iv. v. vi. vii. viii. ix. x. xi. Oscillator Osc. Swich Enable Power Up Timer Brown Out Detect Brown Out Voltage Watchdog Timer CCP2 Mux Stack Overflow Reset Low Voltage Program Code Protect Data EE Read Protect = HS = Disabled = Enabled = Disabled = 4.5V = Disabled-Controlled by SWDTEN bit = RC1 = Disabled = Disabled = All Disabled = Disabled 17

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE Product Users Manual SK40B

xii. xiii. xiv. xv. xvi. xvii. xviii.

Code Protect Boot = Disabled Table Write Protect = All Disabled Data EE Write Protect = Disabled Table Write Protect Boot = Disabled Config. Write Protect = Disabled Table Read Protect = All Disabled Table Read Protect Boot = Disabled

After generating hex code and setting up hardware connection, refer to the following steps for setting up and PIC Tiny Bootloader. 1. Open the 18FBootloader folder (download from SK40A web page), there is a application file named tinybldWin.exe. Double click on it. A window will appear, no installation is required.

2. Choose the baud rate (default is 115200) and COM port (Default is COM1)

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

18

ROBOT . HEAD to TOE Product Users Manual SK40B

a) Load the hex from the Browse icon on the top right corner of the GUI.

b) Reset SK40A and click on Write Flash (within 1 second)

c) If device is found and Write OK, the new HEX file have been loaded, reset PIC and wait for 1 second to execute the new program.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

19

ROBOT . HEAD to TOE Product Users Manual SK40B

d) If new program is needed to be loaded again, just repeat the step from a to c. 3. If bootloader firmware on PIC is corrupted, you will need to burn the firmware using programmer. In this case the bootloader will not work. User may get the firmware in the 18F firmware of 18FBootloader folder which can be downloaded from SK40A webpage. The file name is 18FBootloader v2.hex

Please refer to Appendix A for the detail of schematic. Do consider carefully these preconnect interface if development require those pins. Note: New PIC will not work with bootloader, bootloader firmware is required.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

20

ROBOT . HEAD to TOE Product Users Manual SK40B

6. GETTING STARTED SK40B is ready to be plug and use, no extra driver or software is necessary. It is a hardware platform, for those that use bootloader or UIC00A, please install the necessary driver or configure the correct setting in window. SK40B is ready be used to start the electronics interface. The I/O of the microcontroller can be access through few methods: 1. I/O port (Top) Connect the components that needed onto the I/O port. Extend the I/O port to another board using jumper wire

2. I/O pins (Bottom) Plug the I/O pins of the Start-up Kit onto a breadboard. Then, access I/O pin through the breadboard.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

21

ROBOT . HEAD to TOE Product Users Manual SK40B

Plug the I/O pins of the Start-up Kit onto a donut board. Solder the pins onto the board to access the I/O.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

22

ROBOT . HEAD to TOE Product Users Manual SK40B

7. WARRANTY Product warranty is valid for 6 months. Warranty only applies to manufacturing defect. Damage caused by mis-use is not covered under warranty. Warranty does not cover freight cost for both ways.

Prepared by Cytron Technologies Sdn. Bhd. 19, Jalan Kebudayaan 1A, Taman Universiti, 81300 Skudai, Johor, Malaysia. Tel: Fax: +607-521 3178 +607-521 1861

URL: www.cytron.com.my Email: support@cytron.com.my sales@cytron.com.my

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

23

ROBOT . HEAD to TOE Product Users Manual SK40B

Appendix A

Created by Cytron Technologies Sdn. Bhd. All Right Reserved

24

You might also like