Beruflich Dokumente
Kultur Dokumente
Personal tools
Log in
Views
Contents
1 Introduction 2 Specification 3 DFRduino RoMeo Pinout 4 Before you start 4.1 Applying Power 4.2 Software 5 Romeo Configuration 5.1 Servo Power Select Jumper 5.2 Motor Control Pin Jumper 5.3 Wireless Select Jumper 6 Tutorial 6.1 Button Press 6.2 Example use of Button 1-5 7 Dual DC Motor Speed Control 7.1 Hardware Setting 7.2 Pin Allocation 7.3 PWM Control Mode 7.4 PLL Control Mode 8 Schematics
18/03/13
Introduction
RoMeo is an All-in-One microcontroller especially designed for robotics application. Benefit from Arduino open source platform, it is supported by thousands of open source codes, and can be easily expanded with most Arduino Shields. The integrated 2 way DC motor driver and wireless socket gives a much easier way to start your robotic project.
Specification
Atmega 168/328 14 Channels Digital I/O 6 PWM Channels (Pin11,Pin10,Pin9,Pin6,Pin5,Pin3) 8 Channels 10-bit Analog I/O USB interface Auto sensing/switching power input ICSP header for direct program download Serial Interface TTL Level Support AREF Support Male and Female Pin Header Integrated sockets for APC220 RF Module and DF-Bluetooth Module Five I2C Interface Pin Sets Two way Motor Drive with 2A maximum current 7 key inputs DC SupplyUSB Powered or External 7V~12V DC DC Output5V /3.3V DC and External Power Output Dimension90x80mm
DFRduino RoMeo
The picture above shows all of the I/O lines and Connectors on the Romeo, which includes: One Regulated Motor Power Input Terminal (6v to12v)
18/03/13
One Unregulated Servo Power Input Terminal (you supply regulated 4v to 7.2v) One Servo input power selection jumper One Serial Interface Module Header for APC220/Bluetooth Module Two DC Motor Terminals Handles motor current draw up to 2A, each terminal One I2C/TWI Port SDA, SCL, 5V, GND One Analog Port with 8 analog inputs one input is tied internally to the supply voltage One General Purpose I/O Port with 13 I/O lines 4,5,6,7 can be used to control motors One Reset Button Jumper bank to Enable/Disable Motor Control
Romeo Configuration
Servo Power Select Jumper As most servo draw more current than the USB power source can supply. A separate servo power terminal is provided to power the servo individually which can be Enable/Disable by the Servo Power Select Jumper. When the Servo Power Select Jumper is applied, the servo is powered by internal 5V. When the Servo Power Select Jumper is not applied, the servo is powered by external power source. The Romeo V1.0 uses an automatic switcher for the power source selection. When the external power source has been applied, the servo will be automatically powered by the external power instead of USB power. Motor Control Pin Jumper Applying the Motor Control Pin Jumpers will allocate Pin 5,6,7,8 for motor control. Removing the jumpers will release the above Pins. Wireless Select Jumper Applying the Wireless Select Jumper will allow the Romeo communicate via its wireless module such as APC220 and DF-Bluetooth module. If no wireless module is plugged, this jumper does not make any difference. Removing the jumper will disable wireless module and allows the sketch to be uploaded.
Tutorial
Button Press RoMeo has 7 build in buttons S1-S7 (Figure 2). S1-S5 use analog input 7, S6,S7 use digital input 2 and 3.
18/03/13
"Button Pin Map" Pin Digital Pin 2 Digital Pin 3 Analog Pin 7 Function Button S6 Button S7 Button S1-S5
18/03/13
To enable S6 and S7, please apply the jumpers indicated in the red circle. S6 uses Digital Pin2, S7 uses Digital Pin3. Once these enable jumpers have been applied, Pin 2 and 3 will be occupied (Figure 3).
18/03/13
18 19 { i g i t a l W r i t e ( l e d P i n ,H I G H ) ; / / 20d } 21 i f ( v a l = = 2 ) 22 { v a l = 0 ; 23 d i g i t a l W r i t e ( l e d P i n ,L O W ) ; 24 } 25} 26 27
/ /
18/03/13
Pin Allocation
"PWM Mode" Pin Digital 4 Digital 5 Digital 6 Digital 7 Function Motor 1 Direction control Motor 1 PWM control Motor 2 PWM control Motor 2 Direction control
"PLL Mode" Pin Digital 4 Digital 5 Digital 6 Digital 7 Function Motor 1 Enable control Motor 1 Direction control Motor 2 Direction control Motor 2 Enable control
18/03/13
The PWM DC motor control is implemented by manipulating two digital IO pins and two PWM pins. As illustrated in the diagram above (Figure 5), Pin 4,7 (7,8 for old Romeo version) are motor direction control pins, Pin 5,6 (6,9 for old Romeo version) are motor speed control pins. For previous Romeo board, the pins used to control the motor is Pin 7,8 (Direction), Pin 6,9 (Speed). You can find the information at the right side of the Motor Control Pin Jumpers. Sample Code ? 1 2 3 4 5 6 7 / / S t a n d a r dP W MD Cc o n t r o l 8 i n tE 1=5 ; / / M 1S p e e dC o n t r o l 9 i n tE 2=6 ; / / M 2S p e e dC o n t r o l 10i n tM 1=4 ; / / M 1D i r e c t i o nC o n t r o l 11i n tM 2=7 ; / / M 1D i r e c t i o nC o n t r o l 12 / / F o rp r e v i o u sR o m e o ,p l e a s eu s et h e s ep i n s . 13/ / / i n t E 1 = 6 ; / / M 1 S p e e d C o n t r o l 14 / / i n tE 2=9 ; / / M 2S p e e dC o n t r o l 15/ / i n tM 1=7 ; / / M 1D i r e c t i o nC o n t r o l 16/ / i n tM 2=8 ; / / M 1D i r e c t i o nC o n t r o l 17 18 19v o i ds t o p ( v o i d ) / / S t o p 20{ i g i t a l W r i t e ( E 1 , L O W ) ; 21 d d i g i t a l W r i t e ( E 2 , L O W ) ; 22} 23v o i da d v a n c e ( c h a ra , c h a rb ) / / M o v ef o r w a r d 24{ n a l o g W r i t e( E 1 , a ) ; / / P W MS p e e dC o n t r o l 25 a d i g i t a l W r i t e ( M 1 , H I G H ) ; 26 a n a l o g W r i t e( E 2 , b ) ; 27 d i g i t a l W r i t e ( M 2 , H I G H ) ; 28} 29v o i db a c k _ o f f( c h a ra , c h a rb ) / / M o v eb a c k w a r d 30{ n a l o g W r i t e( E 1 , a ) ; 31 a d i g i t a l W r i t e ( M 1 , L O W ) ; 32 a n a l o g W r i t e( E 2 , b ) ;
18/03/13
i g i t a l W r i t e ( M 2 , L O W ) ; 33 d 34} o i dt u r n _ L( c h a ra , c h a rb ) / / T u r nL e f t 35v { 36 a n a l o g W r i t e( E 1 , a ) ; 37 d i g i t a l W r i t e ( M 1 , L O W ) ; n a l o g W r i t e( E 2 , b ) ; 38 a i g i t a l W r i t e ( M 2 , H I G H ) ; 39 d } 40v o i dt u r n _ R( c h a ra , c h a rb ) / / T u r nR i g h t 41{ 42 a n a l o g W r i t e( E 1 , a ) ; i g i t a l W r i t e ( M 1 , H I G H ) ; 43 d a n a l o g W r i t e( E 2 , b ) ; 44 d i g i t a l W r i t e ( M 2 , L O W ) ; 45} 46v o i ds e t u p ( v o i d ) 47{ 48 i n ti ; o r ( i = 4 ; i < = 7 ; i + + ) 49 f p i n M o d e ( i ,O U T P U T ) ; 50 S e r i a l . b e g i n ( 1 9 2 0 0 ) ; / / S e tB a u dR a t e 51 S e r i a l . p r i n t l n ( " R u nk e y b o a r dc o n t r o l " ) ; 52} 53v o i dl o o p ( v o i d ) 54{ f ( S e r i a l . a v a i l a b l e ( ) ) { 55 i c h a rv a l=S e r i a l . r e a d ( ) ; 56 i f ( v a l! =1 ) 57 { 58 s w i t c h ( v a l ) { 59 c a s e' w ' : / / M o v eF o r w a r d 60 a d v a n c e( 2 5 5 , 2 5 5 ) ; / / m o v ef o r w a r di nm a xs p e e d 61 b r e a k ; 62 c a s e' s ' : / / M o v eB a c k w a r d 63 b a c k _ o f f( 2 5 5 , 2 5 5 ) ; / / m o v eb a c ki nm a xs p e e d 64 b r e a k ; 65 c a s e' a ' : / / T u r nL e f t t u r n _ L( 1 0 0 , 1 0 0 ) ; 66 b r e a k ; 67 c a s e' d ' : / / T u r nR i g h t 68 t u r n _ R( 1 0 0 , 1 0 0 ) ; 69 b r e a k ; 70 c a s e' z ' : 71 S e r i a l . p r i n t l n ( " H e l l o " ) ; b r e a k ; 72 c a s e' x ' : 73 s t o p ( ) ; 74 b r e a k ; 75 } 76 } 77 e l s es t o p ( ) ; 78 } 79} 80 81 82 83 84 85
18/03/13
Sample Code ? 1 2 3 4 / S t a n d a r dD L LS p e e dc o n t r o l 5 / 6 i n tE 1=4 ; / / M 1S p e e dC o n t r o l 7 i n tE 2=7 ; / / M 2S p e e dC o n t r o l 8 i n tM 1=5 ; / / M 1D i r e c t i o nC o n t r o l 9 i n tM 2=6 ; / / M 1D i r e c t i o nC o n t r o l 10 11 / / / F o rp r e v i o u sR o m e o ,p l e a s eu s et h e s ep i n s . 12/ / i n tE 1=6 ; / / M 1S p e e dC o n t r o l 13/ / i n tE 2=9 ; / / M 2S p e e dC o n t r o l / i n tM 1=7 ; / / M 1D i r e c t i o nC o n t r o l 14/ / i n tM 2=8 ; / / M 1D i r e c t i o nC o n t r o l 15/ 16 / / W h e nm 1 p / m 2 pi s1 2 7 ,i ts t o p st h em o t o r 17/ / w h e nm 1 p / m 2 pi s2 5 5 ,i tg i v e st h em a x i m u ms p e e df o ro n ed i r e c t i o n 18/ / W h e nm 1 p / m 2 pi s0 ,i tg i v e st h em a x i m u ms p e e df o rr e v e r s ed i r e c t i o n 19 20v o i dD r i v e M o t o r P ( b y t em 1 p ,b y t em 2 p ) / / D r i v eM o t o rP o w e rM o d e 21{ 22 i g i t a l W r i t e ( E 1 ,H I G H ) ; 23 d a n a l o g W r i t e ( M 1 ,( m 1 p ) ) ; 24 25 d i g i t a l W r i t e ( E 2 ,H I G H ) ; 26 a n a l o g W r i t e ( M 2 ,( m 2 p ) ) ; 27 28} 29 o i ds e t u p ( v o i d ) 30v 31{
i n ti ;
18/03/13
o r ( i = 6 ; i < = 9 ; i + + ) 32 f p i n M o d e ( i ,O U T P U T ) ; 33 S e r i a l . b e g i n ( 1 9 2 0 0 ) ; / / S e tB a u dR a t e 34} 35v o i dl o o p ( v o i d ) 36{ f ( S e r i a l . a v a i l a b l e ( ) ) { 37 i c h a r v a l = S e r i a l . r e a d ( ) ; 38 i f ( v a l ! = 1 ) 39 { 40 s w i t c h ( v a l ) 41 { 42 c a s e' w ' : / / M o v eF o r w a r d D r i v e M o t o r P ( 0 x f f , 0 x f f ) ;/ /M a xs p e e d 43 b r e a k ; 44 c a s e' x ' : / / M o v eB a c k w a r d 45 D r i v e M o t o r P ( 0 x 0 0 , 0 x 0 0 ) ; 46 ;/ /M a xs p e e d 47 b r e a k ; 48 c a s e' s ' : / / S t o p D r i v e M o t o r P ( 0 x 7 f , 0 x 7 f ) ; 49 b r e a k ; 50 51 } 52 } 53 } 54} 55 56 57 58
Schematics
Romeo Schematic V0.9 (http://www.dfrobot.com/wiki/images/a/a0/RoMeo_Schematic.png) Romeo Schematic V1.0 (http://www.dfrobot.com/image/data/DFR0004/RoMeo_Schematic_V1.pdf)
Go Shopping Romeo-All in one Controller (Arduino Compatible Atmega 328) (SKU:DFR0004) (http://www.dfrobot.com/index.php? route=product/product&keyword=DFR0004&category_id=0&description=1&model=1&product_id=56) Retrieved from "http://www.dfrobot.com/wiki/index.php/DFRduino_Romeo-All_in_one_Controller_(SKU:DFR0004)" Categories: Product Manual | DFR Series | Motor Controllers | MicroControllers
Sign up for DFRobot"s newsletter We"ll never spam or give this address away
18/03/13
Brands Warranty Contact Us Gift Vouchers Privacy Policy Returns Affiliates Shipping Site Map Specials Payment