Position Controller from Motor Mount kit
I'm the new member to the forum (but certainly not new to Parallax products!)
The Position Controller from the new Motor Mount and Wheel Kit has a single data line to send and receive information about the encoder.
I am not using any Basic Stamps, instead, I'm using an ARM processor. This particular development board that I have, has 2 separate pins to communicate through UART - one pin to receive, one pin to transmit.
The description of the data line says that its function is "Communication line used to send and receive data - connect to single-wire UART bus."
How in the world do I physically connect two pins from my microprocessor, to that single data line on the Position Controller? I've googled around and there was a lengthy MAXIM explanation how I might make an I/O Pin a master for the bus.
The whole reason for this is because I only want to be able to query the position of the wheels - I'm bypassing the control and sending PWM straight to the HB-25.
So, any ideas? Any references you guys can make?
Thanks in advance!
Trish
The Position Controller from the new Motor Mount and Wheel Kit has a single data line to send and receive information about the encoder.
I am not using any Basic Stamps, instead, I'm using an ARM processor. This particular development board that I have, has 2 separate pins to communicate through UART - one pin to receive, one pin to transmit.
The description of the data line says that its function is "Communication line used to send and receive data - connect to single-wire UART bus."
How in the world do I physically connect two pins from my microprocessor, to that single data line on the Position Controller? I've googled around and there was a lengthy MAXIM explanation how I might make an I/O Pin a master for the bus.
The whole reason for this is because I only want to be able to query the position of the wheels - I'm bypassing the control and sending PWM straight to the HB-25.
So, any ideas? Any references you guys can make?
Thanks in advance!
Trish
Comments
I'm not sure, but can I repeat this on my ARM board?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
___________________________________________
"It's not procrastination, it's a tactical delay." ~Worf
The interesting thing is the processors that they use for the BS's and BS2's are Microchip's PIC or from Ubicom. I'd be curious to see how they handled their dedicated serial lines in order to have the BS's have serial lines on any pin.
Nevertheless, this still doesn't solve my problem. [noparse]:o[/noparse](
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"It's not procrastination, it's a tactical delay." ~Worf
Sorry for the delay in responding to your post. It is true that the Position Controller uses an ATtiny2313, and that the Tx pin (PD1) is connected to the Rx pin (PD0) via a 2.2k resistor. This resistor makes the Tx pin drive the bus more softly, and protects the pin if bus contention happens to occur (which shouldn't happen if your code is correct ).
As you read in the product documentation, up to four position controllers can be connected on the same single-wire serial bus. It might seem like a problem to connect all four if one of the Tx pins is trying to drive the line high through a 2.2k resistor while the other three are trying to drive the line low. However, this is not a problem due to an interesting configuration of the Tx pin on the UART (serial port). Whenever the Tx pin is not actively transmitting data, it remains an input pin - high impedance. Therefore the above scenario works because the Tx pin is trying to drive the line high through a 2.2k resistor while the other three Tx pins just look like open circuits (because they are not actively trying to send data at the same time). This detail is not apparent by just looking at the schematic.
This should now provide some insight as to how you should connect and configure the pins on your microcontroller. Connect the Tx and Rx pins together to create your single-wire serial bus. Configure the Tx pin to return to an input pin (high impedance) whenever it is not transmitting. Also, you do not need a 2.2k resistor in series with the Tx pin (like on the Position Controller) since that microcontroller will take priority on the bus.
Attached is a .pdf of an example circuit schematic for this application.
Another consideration, that is also not apparent by looking at the schematic, is that internal pull-up resistors are used on the Tx pins when they are set as inputs. This makes the Tx pins somewhat less "high"-impedance than they would otherwise be; however, this ensures that the bus doesn't float around (potentially triggering false data) when no devices are driving it.
Good luck! Don't hesistate to ask if you have any other questions!
-Kevin
I'll let everyone know how it turns out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"It's not procrastination, it's a tactical delay." ~Worf
I just got my system up and working and now I'm actually ready to use the single-wired UART on the Position Controller. I just realized something. Normally all the Basic Stamps produce outputs at 5v. The ARM processor produces high outputs at 3.3v If I go ahead and do what you suggested, will I have to bump up the UART transmit pin on the ARM from 3.3v to 5v in order to "speak" to the Position Controller?
Thanks!
Trish
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"It's not procrastination, it's a tactical delay." ~Worf
Typically 3.3V logic is compatible with the inputs of TTL/CMOS equipment because 3.3V is still above the minimum voltage for a high condition.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"It's not procrastination, it's a tactical delay." ~Worf
Sorry for the extremely late response but I've just now finally got a chance to work on the Position Controller part of my project. I am having trouble, still, communicating from my ARM processor to the single-wired UART on the Position Controller. I am not getting a response from the Position Controller. I followed the setup that Kevin posted earlier on this thread in July. My transmit and receive pins from the ARM are tied together and that is tired to the Data line of the Position Controller. The way my C code is written on the ARM as:
1. Set up transmit and receive pins
2. Send out hex 12 (LSB) to query speed on ID 2 (and I made sure that my AB jumpers were set up right on the Position Controller)
3. Change the transmit pin to an input pin
4. Should receive response by Position Controller
I have actually seem the transmission pin send out the hex 12 using a USBEE RS232 Logic Analyzer. So see the ARM sending the query, but I see nothing being returned from the Position Controller.
Is there something else I'm missing? Do I need to use pull up resistors on the ARM pins?
Any help would be grateful. This is last piece of my puzzle and this year long project could be done very soon.
Thanks!
Trish
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"It's not procrastination, it's a tactical delay." ~Worf
You cannot tie your RX/TX pins together. What will happen is that when the controller is trying to send a response back it will be fighting against your TX pin which is already asserting the line. And your RX pin will only see what the TX pin does. We have some circuits that combine 2 signal lines into a single bi-directional line. For an example please see the following link. Take care.
http://forums.parallax.com/showthread.php?p=640507
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"It's not procrastination, it's a tactical delay." ~Worf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Trish
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"It's not procrastination, it's a tactical delay." ~Worf