Go to Post Push the envelope a little, but not too much. There's a difference between being on the cutting edge and being on the bleeding edge. - cadandcookies [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-01-2006, 04:41
AMIRAM AMIRAM is offline
Registered User
no team
 
Join Date: Jan 2006
Location: ISRAEL
Posts: 16
AMIRAM is an unknown quantity at this point
Smile serial port interface

Hi

im using the FRC tTL serial port to connect another controller to my robot

and i dont know how to read the serial Data from the other controller...



can Anyone help my with an example on how to read/write from the serial TTL port?


thanks
  #2   Spotlight this post!  
Unread 19-01-2006, 15:48
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: serial port interface

Quote:
Originally Posted by AMIRAM
Hi

im using the FRC tTL serial port to connect another controller to my robot

and i dont know how to read the serial Data from the other controller...



can Anyone help my with an example on how to read/write from the serial TTL port?


thanks
If you use the serial port driver at http://kevin.org/frc, it's very easy to send and receive data from either of the serial ports. Have a look at the process_data_from_master_up() function in serial_port_diagnostics.zip/user_routines.c for an example that moves data from/to both serial ports.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 19-01-2006, 20:12
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Unhappy Re: serial port interface

Can you use the serial port 1 to connect to another 18 series pic eventhough that port has a RS232 chip interfaced to connect to PC.

Can't use serial port 2 since the camera is using it.

How many sensors can you put on the FRC before you start pushing it(including Camera)?

Thanks.
  #4   Spotlight this post!  
Unread 19-01-2006, 22:11
fowlerm's Avatar
fowlerm fowlerm is offline
Bringing .NET to Robots
AKA: Matthew Fowler
FRC #0312 (Heatwave); FRC #1369 (Minotaur)
Team Role: Engineer
 
Join Date: Apr 2005
Rookie Year: 2001
Location: St. Petersburg, FL, USA
Posts: 78
fowlerm has a spectacular aura aboutfowlerm has a spectacular aura aboutfowlerm has a spectacular aura about
Re: serial port interface

Quote:
Originally Posted by 6600gt
Can you use the serial port 1 to connect to another 18 series pic eventhough that port has a RS232 chip interfaced to connect to PC.
Yep, but you'll have to use another level shifter to get from RS232 back to TTL on your other pic.
  #5   Spotlight this post!  
Unread 19-01-2006, 22:15
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: serial port interface

So have like a external MAX232 wired to the pic?
  #6   Spotlight this post!  
Unread 20-01-2006, 09:09
pclements's Avatar
pclements pclements is offline
Registered User
AKA: Patrick
FRC #1254 (Entropy)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Lawrence
Posts: 18
pclements is an unknown quantity at this point
Send a message via Yahoo to pclements
Re: serial port interface

why would you use a different controller if the other one works just fine?
  #7   Spotlight this post!  
Unread 20-01-2006, 09:26
AMIRAM AMIRAM is offline
Registered User
no team
 
Join Date: Jan 2006
Location: ISRAEL
Posts: 16
AMIRAM is an unknown quantity at this point
Re: serial port interface

Quote:
Originally Posted by pclements
why would you use a different controller if the other one works just fine?


becuse the sensor that i want to use is slow and give me the data in pulse width and if ill be witing for the pulse ,the program wont send the Data evry 26mS and wont work....
  #8   Spotlight this post!  
Unread 20-01-2006, 09:33
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: serial port interface

Thats the thing i don't how far you can push the RC. I want quite a bit of accuracy form both the accelerometer and a the gyro. I would also like to keep track of the RPM's of the spinning wheel in the shooter to adjust the power as required.

Now with the camera and these sensors and trig functions, you could easily push the RC to its limits, I think.
  #9   Spotlight this post!  
Unread 20-01-2006, 12:00
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: serial port interface

Quote:
Originally Posted by 6600gt
Thats the thing i don't how far you can push the RC. I want quite a bit of accuracy form both the accelerometer and a the gyro. I would also like to keep track of the RPM's of the spinning wheel in the shooter to adjust the power as required.

Now with the camera and these sensors and trig functions, you could easily push the RC to its limits, I think.
Offloading this extra work onto another microcontroller is a great idea.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #10   Spotlight this post!  
Unread 20-01-2006, 14:45
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: serial port interface

I can use your code for the pic, Kevin?
  #11   Spotlight this post!  
Unread 20-01-2006, 16:20
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: serial port interface

Quote:
Originally Posted by 6600gt
I can use your code for the pic, Kevin?
There's only two things I care about: 1) The code not be posted on other publicly viewable websites, FTP sites, CVS, etc. 2) The code be used for educational purposes only (i.e., not used to make a profit for someone). If this is for your FRC robot, you're encouraged to use the code anyway you see fit. I've been hoping someone would do what you intend to do. If you get stuck, I'll be happy to help you out if I can.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #12   Spotlight this post!  
Unread 22-01-2006, 11:15
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: serial port interface

Quote:
Originally Posted by 6600gt
Thats the thing i don't how far you can push the RC. I want quite a bit of accuracy form both the accelerometer and a the gyro. I would also like to keep track of the RPM's of the spinning wheel in the shooter to adjust the power as required.

Now with the camera and these sensors and trig functions, you could easily push the RC to its limits, I think.
So far we've got a program that's running fine with six encoders (each generating around 1000 pulses/sec), the gyro, some prototype DAA code, the camera, several PID controllers, and a bunch of math using (floating point!) trig functions, and it all fits comfortably on the RC so far and is working fairly reliably (the camera occasionally goes off into la-la land for as yet undetermined reasons, but if I reset it and the RC it's always fine). That said, this is just the nuts and bolts, getting all the code ironed out, the PID parameters properly set, and autonomous mode working are going to take a lot of time and effort on the part of several students.

I suspect that if I need too many more trig functions or the code gets too slow, we'll have to address the issue (probably by replacing the floating point math with fixed point trig routines), but for now I'm pleasantly surprised with what this year's RC can do.
  #13   Spotlight this post!  
Unread 22-01-2006, 21:16
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: serial port interface

Quote:
Originally Posted by kaszeta
So far we've got a program that's running fine with six encoders (each generating around 1000 pulses/sec), the gyro, some prototype DAA code, the camera, several PID controllers, and a bunch of math using (floating point!) trig functions, and it all fits comfortably on the RC so far and is working fairly reliably (the camera occasionally goes off into la-la land for as yet undetermined reasons, but if I reset it and the RC it's always fine). That said, this is just the nuts and bolts, getting all the code ironed out, the PID parameters properly set, and autonomous mode working are going to take a lot of time and effort on the part of several students.

I suspect that if I need too many more trig functions or the code gets too slow, we'll have to address the issue (probably by replacing the floating point math with fixed point trig routines), but for now I'm pleasantly surprised with what this year's RC can do.
It would be really sweet to get it working, I think.
How accurate do you think you can go for a navigation system using the gyro and accelerometer? I want like 1 cm resolution at 10m/s, on paper at least.

Whats DAA? and What do you need 6 encoder for(at 1000 pules/sec)?
  #14   Spotlight this post!  
Unread 20-01-2006, 11:20
fowlerm's Avatar
fowlerm fowlerm is offline
Bringing .NET to Robots
AKA: Matthew Fowler
FRC #0312 (Heatwave); FRC #1369 (Minotaur)
Team Role: Engineer
 
Join Date: Apr 2005
Rookie Year: 2001
Location: St. Petersburg, FL, USA
Posts: 78
fowlerm has a spectacular aura aboutfowlerm has a spectacular aura aboutfowlerm has a spectacular aura about
Re: serial port interface

Quote:
Originally Posted by 6600gt
Can't use serial port 2 since the camera is using it.
You could connect the CMUcam to the program port since it already uses RS232, and then connect your other pic to the TTL port directly. If you're concerned about runnning a whole DB9 serial cable to the camera you could just buy a DB9 connector and replace one end of a pwm cable with the DB9. The CMUcam already has a PWM-style 3-pin connector for RS232 Tx, Rx, and ground (which is all you need).
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CMUcam2 Serial Port Diagnostics Kevin Watson Programming 13 18-02-2006 15:05
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
Updated: Serial Port Driver Code Kevin Watson Programming 4 05-02-2005 18:39
New Serial Port Driver Kevin Watson Programming 16 09-01-2005 01:56
TTL Serial Port and PS2 Mouse Interface cbolin Electrical 8 29-12-2004 15:00


All times are GMT -5. The time now is 01:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi