Wiki source code of LSS-2MC Board

Last modified by Eric Nantel on 2023/05/29 07:33

Show last authors
1 {{lightbox image="LSS-2MC.png" width="350"/}}
2
3 [[[[image:[email protected]||alt="buy-online.jpg"]]>>https://www.robotshop.com/products/lynxmotion-ses-v2-arduino-compatible-12a-dual-motor-controller-lss-lss-2mc||rel="noopener noreferrer" target="_blank"]]
4
5 **Table of Contents**
6
7 {{toc/}}
8
9 = Description =
10
11 The Lynxmotion LSS-2MC ("Lynxmotion Smart Servo To Motor Controller") module was designed as a multi-purpose, Arduino programmable board intended to "bridge the gap" between a Lynxmotion Smart Servo (LSS) serial bus and one or two electromechanical devices operating on PWM input like brushed DC motors (used to rotate fans, pumps or wheels for example), or LEDs. The onboard motor controller chip also allows for control of one bipolar stepper motor using all four pins. Although a default program is included when shipped, it can be re-programmed using the standard Arduino IDE software to communicate with the onboard motor controller acting as a standard Arduino board.
12
13 = Features =
14
15 * Dual 1.2A H-Bridge motor driver ([[MP6508GR-P>>attach:MP6508.pdf]])
16 * USB Type-C connector
17 * 2x LSS connectors allow for daisy chaining
18 * Input / Output A3 pin under the USB Type-C (Unpopulated / Solder pads only)
19 * LED (red): Tx-Rx USB serial activity
20 * LED (green): Power LED (PWR)
21 * Arduino Nano bootloader installed & Arduino IDE compatible
22 * Lynxmotion Smart Servo (LSS) mounting pattern
23 * Same form factor as the** **[[LSS - Power Hub>>doc:servo-erector-set-system.ses-electronics.ses-modules.lss-power-hub.WebHome||rel="noopener noreferrer" target="_blank"]] / [[doc:servo-erector-set-system.ses-electronics.ses-modules.lss-2io-board.WebHome]] / [[doc:servo-erector-set-system.ses-electronics.ses-modules.lss-5vr.WebHome]]
24
25 = Specifications =
26
27 * Microcontroller: ATMega328P
28 * USB-to-Serial IC: CH340E ([[Driver Download>>http://www.wch-ic.com/search?q=CH340&t=downloads]])
29 * Logic voltage: 5V
30 * Analog voltage: 5V
31 * 5V maximum current: 200mA
32 * Number of analog pins: 1 (A3)
33 * Input voltage via LSS connector: 6V-12V
34 * Maximum rated current through LSS connectors: 2A
35
36 = Schematic =
37
38 The complete schematic can be downloaded [[HERE>>attach:LSS 2MC Board V0.3.pdf]].
39
40 = Communication =
41
42 Using the LSS-2MC with its Lss2MC example code requires that the user understand the Protocol which is available  [[HERE>>doc:.2mc-communication-protocol.WebHome]].
43 The code is available on GitHub and in the [[AlternativeLSS>>https://github.com/Lynxmotion/AlternativeLSS]] library through the Arduino IDE library manager.
44
45 **Internal Serial Connection**
46
47 The board is effectively a "peripheral". In order to respond to LSS commands, it needs to be running appropriate code, or the default Lss2MC Arduino sample program.
48 Pinout is as follows:
49
50 * ATMega328P's Tx pin (D1) is connected to the LSS Tx line through a [[tri-state buffer (IC3)>>https://en.wikipedia.org/wiki/Three-state_logic||rel="noopener noreferrer" target="_blank"]] that can be enabled or disabled with pin D14.
51 * ATMega328P's Rx pin (D0) is connected to the LSS Rx line.
52
53 Therefore data that is sent from an external UART device will be received on the LSS Rx line and the ATMega328P Rx pin. The LSS-2MC USB-to-Serial IC Tx is connected to the ATMega328P Rx (pin D0) through another [[tri-state buffer (IC4)>>https://en.wikipedia.org/wiki/Three-state_logic||rel="noopener noreferrer" target="_blank"]] that can be enabled/disabled with pin D7. The Lss2MC Arduino code inherently takes care of managing the pins D14 and D7 as follows :
54
55 * **D7 **is LOW**: **to disconnect 2MC USB-to-Serial IC Tx from ATMega328P Rx (pin D0) allowing the ATMega328P to receive data from the UART controller device as 2MC USB-to-Serial IC Tx is HIGH when 2MC is powered.
56 * **D14** is HIGH**:** when the 2MC Board is sending data on the LSS Tx line to an external UART device Rx pin. LSS Tx line is asserted to the 2MC Tx pin :
57
58 {{lightbox image="LSS-2MC-Schematic-2RC-D14HIGH.png" width="900"/}}
59
60 * **D14 **is LOW**:** when the 2IO Board is not sending data on the LSS Tx line. The 2IO frees up the LSS Tx line to avoid bus congestion (when 2 devices sends data at the same time) :
61
62 {{lightbox image="LSS-2MC-Schematic-2RC-D14LOW.png" width="900"/}}
63
64 = Pinout =
65
66 |(% colspan="3" %)**Top External Pins**
67 |(% colspan="1" rowspan="8" style="text-align:center; vertical-align:middle; width:300px" %){{lightbox image="LSS-2MC-External.png"/}}|(% style="width:35px" %)[[image:[email protected]]]|**Vin**: Input voltage supplied by LSS bus (6V to ~~12V)
68 |[[image:[email protected]]]|**Ground (G)**: Common ground
69 |[[image:[email protected]]]|**LSS Rx**
70 |[[image:[email protected]]]|**LSS Tx**
71 |[[image:[email protected]||alt="SQUARE-Red.png"]]|**H-Bridge Output #1**
72 |[[image:[email protected]||alt="SQUARE-Red.png"]]|**H-Bridge Output #2**
73 |[[image:[email protected]||alt="SQUARE-Blue.png"]]|**H-Bridge Output #3**
74 |[[image:[email protected]]]|**H-Bridge Output #4**
75 |(% colspan="3" %)**Bottom Solder Pins (Optional)**
76 |(% colspan="1" rowspan="3" %){{lightbox image="LSS-2MC-External-Bottom.png"/}}|(% style="vertical-align:middle" %)[[image:[email protected]]]|(% style="vertical-align:middle" %)**Pin A3: **Analog input 3
77 |(% style="vertical-align:middle" %)[[image:[email protected]]]|(% style="vertical-align:middle" %)**5V Out:** Low current output for sensor when used with A3
78 |(% style="vertical-align:middle" %)[[image:[email protected]]]|(% style="vertical-align:middle" %)**Ground (G)**: Common ground
79 |(% colspan="3" %)**Internal Pins / Connections**
80 |(% colspan="1" rowspan="9" %) |(% colspan="2" rowspan="1" %)**Pin D14: **Controls the tri-state buffer (IC3) on the ATMega328P Tx serial line (pulled-down)
81 |(% colspan="2" rowspan="1" %)**Pin D7: **Controls the tri-state buffer (IC4) on CH340E Tx / ATMega328P Rx serial line (pulled-up)
82 |(% colspan="2" rowspan="1" %)**Pin D9: **H-Bridge Input #1
83 |(% colspan="2" rowspan="1" %)**Pin D10:** H-Bridge Input #2
84 |(% colspan="2" rowspan="1" %)**Pin D3: **H-Bridge Input #3
85 |(% colspan="2" rowspan="1" %)**Pin D11:** H-Bridge Input #4
86 |(% colspan="2" rowspan="1" %)**Pins A4:** H-Bridge i2c (SDA = A4)
87 |(% colspan="2" rowspan="1" %)**Pin D2: **H-Bridge NSleep (set high to enable)
88 |(% colspan="2" rowspan="1" %)**Pin D8:** H-Bridge NFault
89
90 = Wiring & Power Options =
91
92 |(% colspan="3" style="width:300px" %)**Power**
93 |(% colspan="1" rowspan="2" style="width:300px" %){{lightbox image="LSS-2MC-Power.png"/}}|(% style="vertical-align:middle; width:35px" %)[[image:[email protected]]]|(% style="vertical-align:middle" %)(((
94 **LSS Connectors: **The board is meant to be powered from ONE of the two LSS connectors. Vin will supply the two on-board 5V regulators (logic and Vout) and to the Lynxmotion Smart Servos connected on the bus. Power will also be supplied to the h-bridge at the same voltage as the bus voltage.
95
96 Refer to LSS Voltage rating in [[LSS - Specifications>>doc:lynxmotion-smart-servo.lss-specifications.WebHome||rel="noopener noreferrer" target="_blank"]]
97 )))
98 |(% style="vertical-align:middle; width:35px" %)[[image:[email protected]||alt="SQUARE-Red.png"]]|(% style="vertical-align:middle" %)(((
99 **USB: **Connecting only the USB will only provide voltage to the logic. It won't power the h-bridge chip.
100 )))
101 |(% colspan="3" style="width:300px" %)~*~*NOTE:~*~* USB and Vin power source are isolated and there are no issues connecting both a USB and a powered LSS bus at the same time
102
103 |(% colspan="2" %)**Sample Wiring / Use**
104 |{{lightbox image="LSS-2MC-Power-LSS-ADA.png"/}}|{{lightbox image="LSS-2MC-Power-LSS-HUB.png"/}}
105 |(% style="text-align:center" %)(((
106 //LSS-2MC on a bus, powered by an LSS-ADA//
107
108 //Lynxmotion Smart Servo is optional //
109 )))|(% style="text-align:center" %)(((
110 //LSS-2MC on a bus, powered by an LSS-HUB //
111
112 //Lynxmotion Smart Servo and LSS-2IO are optional //
113 )))
114
115 == Dual H-Bridge (DC Motors) ==
116
117 |**Sample Wiring / Use**
118 |{{lightbox image="LSS-2MC-Wiring-DC.png" width="900"/}}
119
120 == Bipolar Stepper Motor ==
121
122 |**Sample Wiring / Use**
123 |{{lightbox image="LSS-2MC-Wiring-Stepper.png" width="900"/}}
124
125 = Dimensions & Mounting =
126
127 |(% style="width:300px" %){{lightbox image="LSS-2MC-Dimensions.png"/}}|(% style="width:300px" %)[[image:servo-erector-set-system.ses-electronics.ses-modules.lss-2io-board.WebHome@LSS-2IO-Mounting.gif]]|
Copyright RobotShop 2018