View Single Post
  #14   Spotlight this post!  
Unread 09-12-2009, 01:27
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Question about B2Bot ?

How do you have the 74HC254 connected? It appears that it will only send data one direction at a time; since you're using a two-wire system, that's ok, but you'll need to run one of the lines "backwards": i.e. the CMUcam and dsPic should both have their transmit line connected to the A port and their receive line connected to the B port, then connect the direction pin to Vcc so that data flows from port A to port B. If you're not doing this, it could explain why you're able to send data but not receive it. Once you've done this, make sure you set the direction pin accordingly, else you won't get any communication at all.

Since you're using 5v and 3.3v, there's a simpler solution available: Because the SX52 processor that the CMUcam is based on will accept a logic "high" value of 2.0 volts or higher, you should be able to just connect the transmit line of the dsPic straight to the receive line of the CMUcam. For the other direction, you'll still have to shift the voltage down, but since the receive line of the dsPic is fairly high impedance, you can just use a resistor divider. Connect it like this:

Code:
-------                       -------
       |                     |
CMUcam |                     | dsPic
       |       R1            |
    TX-|------VVVV-----------|-RX
       |            |        |
-------             >         -------
                 R2 >
                    >
                    |
                   ---
                   GND
Resistors R1 and R2 in this configuration are called a voltage divider. The voltage the dsPic will see is equal to R2/(R1+R2) so if you pick values like R1=12K, R2=18K then the if the CMUcam sends 5v, the dsPic will see 3v.

If pretty sure you're properly electrically connected, also make sure that your serial parameters are properly set on the dsPic: proper baud rate, 1 stop bit, 8 data bits, no parity, no flow control, etc. The baud rate calculations also depend on what frequency the dsPic is running at, so make sure you're either calculating them correctly, or that if you're using a library it knows what frequency you're running at. Try connecting to the computer like I suggested as well; it's an easy way to make sure these settings are correct.

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor

Last edited by RyanCahoon : 09-12-2009 at 01:31.