Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Problem with TTL-RS232 + CMUCam (http://www.chiefdelphi.com/forums/showthread.php?t=52859)

Shinigami2057 27-01-2007 10:45

Problem with TTL-RS232 + CMUCam
 
For whatever reason, I cannot get the PIC18 to communicate with the camera via the TTL port (shifted to RS-232 of course). I'm 99.9% certain the wiring is correct, and we have 2 level shifters (hopefully both aren't fried) to test with. I'm currently using Kevin's serial port functions and I cannot send or receive anything to/from the camera.

I've even tried loading Kevin's bells and whistles camera program, and that refuses to do anything either (in minicom it just says it is waiting for data). There is no issue communicating with the camera via the DB9 port to the computer (using either minicom or the GUI), so I'm really confused as to what's wrong.

Do I need to set a jumper to enable the 3-pin RS-232 port on the camera, are both level shifters gone, or am I just an idiot (what I'm hoping, we don't really need hardware failure right now)?

Thanks in advance.

Kevin Watson 27-01-2007 11:51

Re: Problem with TTL-RS232 + CMUCam
 
Quote:

Originally Posted by Shinigami2057 (Post 566220)
For whatever reason, I cannot get the PIC18 to communicate with the camera via the TTL port (shifted to RS-232 of course). I'm 99.9% certain the wiring is correct, and we have 2 level shifters (hopefully both aren't fried) to test with. I'm currently using Kevin's serial port functions and I cannot send or receive anything to/from the camera.

I've even tried loading Kevin's bells and whistles camera program, and that refuses to do anything either (in minicom it just says it is waiting for data). There is no issue communicating with the camera via the DB9 port to the computer (using either minicom or the GUI), so I'm really confused as to what's wrong.

Do I need to set a jumper to enable the 3-pin RS-232 port on the camera, are both level shifters gone, or am I just an idiot (what I'm hoping, we don't really need hardware failure right now)?

Thanks in advance.

Is the baud rate correct?
Nothing attached to the DB9?
Are the camera LED(s) on?
Did to try the serial port diagnostics code?
Consulted the FAQ?

-Kevin

Alan Anderson 27-01-2007 20:28

Re: Problem with TTL-RS232 + CMUCam
 
Quote:

Originally Posted by Shinigami2057 (Post 566220)
Do I need to set a jumper to enable the 3-pin RS-232 port on the camera,...?

No, but you do have to remove anything that might be connected to the DB9 connector.

Shinigami2057 28-01-2007 00:19

Re: Problem with TTL-RS232 + CMUCam
 
Okay, thanks for the help, I figured it out. For whatever reason, I guess setting stdout_serial_port to whatever the camera was communicating was mangling the commands I sent to it. Once I reset that to the program port and just starting writing buffers with the byte-oriented functions it worked flawlessly.

Thanks again for the help :)

Bomberofdoom 28-01-2007 00:57

Re: Problem with TTL-RS232 + CMUCam
 
What do you mean by "reset the program port and writing buffers with byte-oriented functions" ?

Shinigami2057 28-01-2007 01:11

Re: Problem with TTL-RS232 + CMUCam
 
Sorry, it's late, I don't make much sense past 1 AM. :p

I mean, I set stdout_serial_port = SERIAL_PORT_ONE and instead wrote a simple function to take a C-style string and write it to the TTL port one byte at a time. i.e.

Code:

void cmucam_write_buf(const rom unsigned char *buf)
{
    int i;
    for(i = 0; i < strlen(buf); i++)
        cmucam_write( buf[i] );
}

cmucam_write_buf("tc 210 240 210 240 210 240\r");


Bomberofdoom 28-01-2007 08:47

Re: Problem with TTL-RS232 + CMUCam
 
:confused:


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

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