Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > Using a host computer to control robotics

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Using a host computer to control robotics
Moderator:
RKRM

Post Reply
Follow this topic



Using a host computer to control robotics

RealChemist posted on 23 Mar 2012 7:35 AM PST
Member
9 Forum Posts

Hey all,

I posted a previous topic about using sonar for a robotics project (which was resolved quickly on this forum).  The next step in the project is to be able to use a Pandaboard to send commands to the PSoC.  The PSoC was chosen to control the robotic subsystems because of its ease of development and the Pandaboard is used as the human interface because it can run a full operating system.

My group needs to be able to get sonar readings taken from the PSoC and it also needs to be able to send commands telling the PSoC to generate PWM signals that go to our H-Bridge/Motor.  Talking to some of our professors, the suggestion was made to use serial over I2C.  What are your thoughts on the best way to implement this?




Re: Using a host computer to control robotics

Gautam Das posted on 23 Mar 2012 10:37 AM PST
Cypress Employee
742 Forum Posts

Hi RealChemist,

 

You can use I2C to communicate between PSoC and Pandaboard. you must configure one of them as Master and the other one as Slave. Since in I2C it is the Master which initiates the communication and generates the clock, the device which has to send commands to the other should be made as a Master. 

Alternately, you may also consider UART for communication. In this protocol, there is no Master - Slave relation. If used in Full-Duplex mode, any device can send to / receive from other device. Pandaboard has DB-9 connector for RS232.



Re: Using a host computer to control robotics

Bob Marlowe posted on 23 Mar 2012 11:16 AM PST
Top Contributor
1768 Forum Posts

The principle of I2C is plain and easy to understand: The slave obeys master (Gollum principle )

This means: The master writes into the slave(s) and read from the slave(s). Note the plural, I2C is made to control several slaves. So no method exists for a slave to talk to the master (asking for support, waking-up master etc) initiated by the slave.

On the other hand UART was made originally for communication between man and machine (woman as well) and both may initiate an 1 to 1 conversation. Additions have been made (and implemented in PSoC of course) to talk to several devices on a bus-like structure. The advantage (in my opinion) is, that the "slave" may initiate a conversation (asking for recharge of battery).

 

I would select UART.

Bob

 



Re: Using a host computer to control robotics

U2 posted on 26 Mar 2012 02:16 AM PST
Cypress Employee
589 Forum Posts

Please also be aware of the limitations on the dat throughput that you might need between PSoC and Pandaboard.



Re: Using a host computer to control robotics

kmmankad posted on 26 Mar 2012 08:23 AM PST
Top Contributor
268 Forum Posts

I2C is easy enough to implement on the PSoC.Surprisingly easy,if I might say so.

I have interfaced an I2C EEPROM,and you can check out my blog post on the same.

http://kmmankad.blogspot.com/2011/11/24lc512-with-psoc3.html

As far as control of motors is concerned,you could hook up a regular L298D(depending on your motors' current requirement) and control it easily with the PSoC.

Hope this helps :-)



Re: Using a host computer to control robotics

Bob Marlowe posted on 26 Mar 2012 12:29 PM PST
Top Contributor
1768 Forum Posts

Since you have to establish a communication - path you will have to define something like a "protocol" that defines who and when may talk to which. It would not be unwise to have a brief look at the OSI-modell to see how this fits in your situation/project. Look here http://en.wikipedia.org/wiki/OSI_model . The requirements  for the protocol will make it easier for you to decide which interface (or interfacES!) will be the right choice.

 

Bob



Re: Using a host computer to control robotics

GIL posted on 28 Mar 2012 07:27 AM PST
Member
10 Forum Posts

I prefer use UART and if you need communicate more boards, use RS485 (not problem with noise environment, no problem with distances, etc,etc). One point to keep in mind it's very easy depurate if no trasnmission exist 

 I've done a 1/2 CNC with PSoC1 (I'm finishing now with PSoC3), 3 boards (1 a axis), everything with RS485.

Besides I've developed a 32 servo controller (with PSoC3) and communication with RS232. (you can see "el bicho" in youtube Look for hexapod PSoC3. I know the quality is very poor. Sorry )
 



Re: Using a host computer to control robotics

Eilrem posted on 04 Apr 2012 12:48 AM PST
Cypress Employee
17 Forum Posts

I prefer I2C over UART since you can connect multiple slaves to 1 master. It's true that slaves can't initiate connection to the master but you can just make the master poll each slave one at a time.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20