Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   serial port interface (http://www.chiefdelphi.com/forums/showthread.php?t=42185)

AMIRAM 19-01-2006 04:41

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

Kevin Watson 19-01-2006 15:48

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

6600gt 19-01-2006 20:12

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.

fowlerm 19-01-2006 22:11

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.

6600gt 19-01-2006 22:15

Re: serial port interface
 
So have like a external MAX232 wired to the pic?

pclements 20-01-2006 09:09

Re: serial port interface
 
why would you use a different controller if the other one works just fine?

AMIRAM 20-01-2006 09:26

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....

6600gt 20-01-2006 09:33

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.

fowlerm 20-01-2006 11:20

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).

Kevin Watson 20-01-2006 12:00

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

6600gt 20-01-2006 14:45

Re: serial port interface
 
I can use your code for the pic, Kevin?

Kevin Watson 20-01-2006 16:20

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

6600gt 20-01-2006 18:29

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?

AMIRAM 22-01-2006 02:03

Re: serial port interface
 
is ther any rule about connecting another microcontroller to the FRC??

SoftwareBug2.0 22-01-2006 02:12

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.


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

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