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.

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

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

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 :slight_smile:

What do you mean by “reset the program port and writing buffers with byte-oriented functions” ?

Sorry, it’s late, I don’t make much sense past 1 AM. :stuck_out_tongue:

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.


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

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

:confused: