3. INTRODUCTION
Welcome to the ECET Robotic Car Kit. The following kit contain parts for TWR-
S12G128 microcontroller tower, SRK + Line kit, and all the associated wires, and connectors to
operate the automated robot. This specific model follows a black strip line race track based on
the users design. This manual contain information for assembly, troubleshooting tips, schematic
diagrams, coding information and software. It also contains contact information for customer
service at the end of the manual.
6. Power Supply Subsystems
18650 Lithium Ion Batteries
● Typical Capacity: 3000 mAh
● Min Capacity: 2900 mAh
● Nominal Voltage: 3.7V
● Charging Voltage: 4.35V
12 volt regulator - 7812
● Max Amperage output:1 amp
5 volt regulator - 7805
● Max Amperage output:1 amp
5V To 3.3V DC-DC Step-Down Power Supply Buck Module
● Operating Supply Voltage: 4.2 V to 10 V
● Output Current: 800mA
● Output Voltage: 3.3 V
Motor Subsystems
SN754410NE - H Bridge
● Operating Supply Voltage: 4.5 V to 36 V
● Output Current: 1100 mA
Digilent 12v motor
● Max Operating Supply Voltage: 12 V
● Output Current: 240 mA
● Torque: 617 g-cm
Sensor Subsystems
OPB704
● Max Collector Current:25 mA
● Vf - Forward Voltage: 1.7 V
7. GETTING STARTED
Chassis assembly requires a fillister head screwdriver, needle nose pliers, wire strippers, and the
associated mounts with-in the kit.
8. Attach the four sensor with the double sided Velcro strips in the front of the chassis.
Attach the microcontroller TWR-12SG128 to the robots chassis via tie-raps or use the extra
bracket with screws.
9. Power Supply assembly for +5V (7805CT) voltage regulator.
This how the robot will look when it has finally been assembled.
Robot Code
//sensor 1 pp0 pin A40 black
//sensor 2 pp1 pin A39 red
//sensor 3 pp2 pin A38 white
//sensor 1 pp0 pin A40 black
//sensor 2 pp1 pin A39 red
//sensor 3 pp2 pin A38 white
//sensor 4 pp3 pin A37 yellow
//sensor layouton thesensor board1,4,2,3(tied intight notmoving them)
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specificdefinitions */
int speed =150;
int delayspeed=5;
int decrease=25;
//function protypes
void delay(unsigned int);//delay
void test(void); //test
void init_PWM01(void); //motor
void init_isr(void); //sensor
void forward(void); //move forward
11. PWMDTY4=(speed/5); //slow down
PWMDTY5=(speed-decrease);
PTT=0x80;
}
void init_isr()//usePP7:PP4
{
DDRP &=~0x0F; //use pp0,pp1,pp2,pp3interrupt pins.
PPSP &=~0x0F;//choosepulldown
PERP |=0x0F;//enablepull
PIEP |=0x0F;//enablelocal leveenable
asm(cli); // enableglobal levelenable
PIFP |=0x0F;// clear allflags on pp0,pp1,pp2,pp3
}
//define ISR
#pragma CODE_SEG NON_BANKED
interrupt((0x10000-0xFF8E)/2-1)
void PortP_isr(void)
{
if ((PIFP&0x02)==0x02) // sensor 2 has gonefrom0 to 1
{
left();
delay(delayspeed);
PIFP|=0x02; // clearflag
}
if ((PIFP&0x01)==0x01) // sensor 1 has gonefrom0 to 1
{
right();
delay(delayspeed);
PIFP|=0x01; // clearflag
}//
if ((PIFP&0x04)==0x04) // sensor 3 has gonefrom0 to 1
{
forward(); //good
delay(delayspeed*2);
PIFP|=0x04; // clearflag
}
if ((PIFP&0x08)==0x08) // sensor 4 has gonefrom0 to 1
{
forward();
delay(delayspeed*2);
PIFP|=0x08; // clearflag
}
}
#pragma CODE_SEG DEFAULT
12. TROUBLESHOOTING TIPS
Tip#1:
Check to see if both the +5V and 12V regulator output voltages are correct. They supply both
voltage to the microcontroller, H-bridge, motors, and sensors. Depending on the model you have
some of our robots contain P-mod H-bridge circuits that require an addition two wires. The
supply voltages are 5V for the microcontroller and motors. Then 3.3 to 5V for each sensor.
Tip#2:
Sometimes there will be a message stating that the microcontroller has not been detected by PC.
First check to see if you download the latest version of CodeWarrior 5.1 are above with the latest
devices driver.
13. Tip#3:
The code associate with the robot is preload on the robot. If there is any issues with the code a
copy of the program can be found for troubleshooting purpose. It is located at the end of the user
manual. (Warning! CodeWarrior IDE interface is case sensitive if any of the code has not been
properly type it will result in an error. The code will not compile neither will it upload to the
microcontroller.)
Tip#4:
If and of the hardware is defective please contact us immediately so we can send you any
replacement parts. The replacement parts included that are PSU battery compartment, motors, H-
bridge, and robot chassis. (If you notice any of the chassis, or electronic hardware missing you
should contact us with a brief description of the part and the serial number/ID number located on
the part.)
14. Make sure that all of the robot wiring and associated components are properly placed and
configure. Because if anything is not properly placed it could lead to possible shortage or
possible damage to electronic components. Also check to make sure that the power supply
system wiring is placed correctly due to possible fire hazard.
15. CONTACT INFORMATION/TECH
SUPPORT
If you have any issues regarding the software and hardware please contact us at
ebarner777@gmail.com for customer support.
If you need to contact our other branches please email us at tim_thegreenbeast@yahoo.comor
b_quiroz@live.com.