Go to Post FIRST isnt about getting what you deserve, FIRST is about other people seeing potential in us - and giving us an opportunity that we could never have earned on our own - KenWittlief [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, 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).
  #10   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
  #11   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?
  #12   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
  #13   Spotlight this post!  
Unread 20-01-2006, 18:29
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 Kevin Watson
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
It is for FRC and i might use it for my personal work or research on the pics but nothing to do with commercial use.

Is there anything really important that I have to modify to make the serial port driver, adc, gyro, and accelerometer code work with a 18F4XX series pic?Other than the usual registers and pins.

Would a CAN bus connection to the TLL port work? What type of serial connection does your serial port drive control?USART?

Last edited by 6600gt : 20-01-2006 at 18:50.
  #14   Spotlight this post!  
Unread 22-01-2006, 02:03
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

is ther any rule about connecting another microcontroller to the FRC??
  #15   Spotlight this post!  
Unread 22-01-2006, 02:12
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 486
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: serial port interface

Quote:
Originally Posted by AMIRAM
is ther any rule about connecting another microcontroller to the FRC??
It's the same rules as any other circuit.
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 06:33.

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