Professional Documents
Culture Documents
User Manual
Table of Contents
1. PACKAGE CONTENTS 2. MOTHERBOARD DESCRIPTION:
2.1. Features 2.2 Parts description and connection details Voltage Regulator Level converter Motor Driver Buzzer Serial port LCD interface Switches LEDs PSMAIN PSMOT
3 4
4 5 5 5 5 5 5 5 6 6 6 6
7
7 7 8 8 9 10
1. Package Contents
Sr.No.
1 2 3
4 5 6 7 8 9
Product
RoboCub mother board (102011) 16x2 LCD module Chassis for building robot
DC geared motor Battery Battery snaper
Quantity
1 1 1
2 2 2 2 1 1
Sensor (102930) Serial cable CD containing user manual software and sample codes
2. Motherboard Description:
2.1. Features
This board is the main board which controls all the functionalities, actions and motions of a robot. This board have the following features. Compatible with most of the 8051 and 8052 series of 40 pin microcontrollers. Available with P89v51rd2 micro controller On board motor driver for driving 2 DC motors or 1 stepper motors Motor enable disable control switch Onboard 4 channel ADC optional LCD interface PC interface through UART 11.0592 MHz crystal Exposed all I/O port for general-purpose application five tact switches for external input, reset and interrupt Four test LEDs for status and debugging purpose Buzzer for generating audible response Exposed ISP pins for Programming on board programmer for p89v51rd2 microcontroller On board regulated power supply Dual power supply for logic and driving load
Serial port This is use to download program in the micro controller through PC and can be use to communicate with the PC through UART. LCD interface It can be used to interface a16x2 LCD in 4 bit mode or it can also be used as a general purpose input output port. The pin connections for interfacing a LCD are given bellow. RSPort0_0 RW- Port 0_1 EPort0_2 D4Port0_4 D5Port0_5 D6Port0_6 D7Port0_7
Switches S1-Port3_2 S2-Port3_3 S3-Port3_4 S4-Port3_5 These switches are connected to port pins of micro controller to give external inputs and interrupt. All this switches are active low. RST-Reset This switch can be use to reset the micro controller. POWER-Power on
This is basically a slide switch. It is use to switch on or off the main power supply of the motherboard.
MOTOR ENABLE
This is basically a slide switch. It is use to enable or disable the motor driver.
LEDs LED1-Port2_0 LED2- Port2_1 LED3-Port2_2 LED4-Port2_3 These LEDs are connected to port pin in active high mode. LED5-Power ON/OFF indicator LED PSMAIN This is use to connect power supply to the Main board (minimum 6VDC maximum 16VDC) PSMOT This is use to connect power supply to the motor (minimum 5VDC maximum 32VDC)
4.2. FEATURES:
80C51 Central Processing Unit 5 V Operating voltage from 0 to 40 MHz 64 KB of on-chip Flash program memory with ISP (In-System Programming) and IAP (In-Application Programming) Supports 12-clock (default) or 6-clock mode selection via software or ISP SPI (Serial Peripheral Interface) and enhanced UART PCA (Programmable Counter Array) with PWM and Capture/Compare functions Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each) Three 16-bit timers/counters Programmable Watchdog timer (WDT) Eight interrupt sources with four priority levels Second DPTR register Low EMI mode (ALE inhibit) TTL- and CMOS-compatible logic levels Brown-out detection Low power modes Power-down mode with external interrupt wake-up Idle mode PDIP40, PLCC44 and TQFP44 packages
C=10uF
+5V
Port 2
33pF
Once the Keil software is installed, to load go to start menu, then programs and select Keil uVision3, click on it. STEP 2:-
STEP 3:-
Once the Keil is loaded an empty work space is displayed. If any project was opened previously, then the same will get displayed.
STEP 4:-
To create new project go to Project -drop down menu select New Project.
STEP 5:-
Once you select the New project, it asks you where to save the project. Specify the path.
STEP 6:-
Once the path has been specified select the chip to be programmed. In our case select Philips, then P89V51RD2 and click OK. STEP 7:-
Once the chip is selected a message box will be displayed asking for whether to load the startup code into the project. Click yes if you want the startup code.(always click on yes) STEP 8:-
This will be the startup code, Now go to File menu and click on New this is will be giving you the new editor where you can write your program codes. STEP 9:-
Towards the right of the project workspace is the new Text editor. Type your program in this new editor. Add the header file of <reg51.h> (copy the header given in CD to C:\Keil\C51\INC\Philips ), which include header file as shown in above. STEP 10:-
Save the file under the already created project with .c extension.
STEP 11:Here I have mentioned source code of led blinking program with description, copy this code to your new text editor . #include < REG51.h > /* Include header file */ /*-----------------------------------------------delay function ------------------------------------------------*/ void delay (void) { unsigned int i,j; /* wait function */ for(i=0;i<100;i++) { for(j=0;j<100;j++) { ; }
} } /*-----------------------------------------------MAIN C function ------------------------------------------------*/ void main(void) { P3 = 0; /* Initialize ZERO to P3. Make it as output port*/ while(1) { P3=0x00; delay(); P3=0xff; delay(); } } STEP 12:To add the file to the project right click on the Source Group and click on Add Files to Group 'Source Group' as show below.
STEP 13:-
STEP 14:-
Under project Select Build target to compile the project. STEP 15:-
Once the project is built the result can be seen at the bottom. If any errors or warnings detected will get detected, else if no errors the build is successful. This only complies and links all the files in the project, no Hex files are created.
STEP 16:-
To create the Hex File right click on Target and select Options for Target.
STEP 17:-
Under Output option select Create HEX File and click OK. Save and compile once again to generate the HEX file.
STEP 18:-
Once the downloadable HEX file is created it gets saved in the folder where the project is saved. STEP 19:-
To enter into the debug mode go to Debug and select Start/Stop Debug Session.
STEP 20:-
Once entered into Debug mode you can perform step by step operation by clicking F10 key to debug the code. You can see the output in the GPIO port window resides in the Peripherals menu.
The hex file of LED program has created. Now to download the hex file into P89V51RD2 Flash magic software is required and UART0. you can also download the hex file over the IN-System Programming interface.
Once the Keil software is installed, to load goto start menu, then programs and select flash magic, click on it.
STEP 2:-
Once the flash magic is loaded a work space is displayed. If any hex file was opened previously, then the same will get displayed on browse text box. STEP 4:-
When you will click on START button to download program, it will display reset device message as show in above figure. STEP6:-
When you will press the Reset Switch, It will start downloading.