CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Level Shifting Question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Setna



Joined: 24 Jun 2008
Posts: 10

View user's profile Send private message

Level Shifting Question
PostPosted: Tue Jun 24, 2008 8:29 am     Reply with quote

Hi,

I'm using the PIC18F6722 Prototyping Board and trying to connect to a CMUCAM3 using a TTL serial port on the camera. I believe that TTL works up to 5V where the RS-232 outputs up to 12V. Do I need another level shifter between these two devices to get them to work or is there some other method that might be easier?

Also, the camera is only transmitting, it does not have to receive anything on its receive pin. Thanks.
stewart



Joined: 28 Nov 2005
Posts: 12

View user's profile Send private message

PostPosted: Tue Jun 24, 2008 8:48 am     Reply with quote

Setna,

I am not sure what a CMUCAM3 is, but
Quote:
using a TTL serial port on the camera


As you said, TTL is commonly 5V and I assume the 5722 board is also 5V. The fact that we call the serial interface RS232 is from a standards committee back in the 80's. +-12V was pick to gain some noise immunity and they had those voltages handy, so they did the level shifting right on the board, that is from the UART chip (5V) up.down to +-12V.

in your case, it sounds like there is no level shift required because both side are 5V. That is if you are sure that the camera is 5V and not 3.3V please be sure.

I hope my explanation helped more than confuse.

Stewart
Setna



Joined: 24 Jun 2008
Posts: 10

View user's profile Send private message

PostPosted: Tue Jun 24, 2008 9:18 am     Reply with quote

Stewart,

I have checked the TTL port and it is at 5V. I guess now my question is, should I use #USE RS232 in my code or setup_uart()?

Also, if I'm understanding correctly, the UART Chip sends out 5V which goes to the RS-232 which alters it to +-12V. If this is correct, would i have to get the voltage before it gets the RS-232 connector, or does it matter. Thanks for your help.

Setna
stewart



Joined: 28 Nov 2005
Posts: 12

View user's profile Send private message

PostPosted: Tue Jun 24, 2008 9:24 am     Reply with quote

Senta

I just do the #use RS232.

Yes, tap off of the TX and RX signales BEFORE the level shifter. But you may need to break the connection from the output of the level shifter that drives your RX pin into the PIC, you don't want the camera and the level shifter fighting over the RX pin. Also the same may be true FOR the TX pin on the PIC, it may not drive both the level shifter and the camera with a nice sharp edge.

Stewart
Setna



Joined: 24 Jun 2008
Posts: 10

View user's profile Send private message

PostPosted: Tue Jun 24, 2008 9:28 am     Reply with quote

Stewart,

Thanks for all your help.

Setna
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group