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 support@ccsinfo.com

5 V PIC conected to 3.3 chip (kbhit function...)

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



Joined: 19 Oct 2004
Posts: 40

View user's profile Send private message

5 V PIC conected to 3.3 chip (kbhit function...)
PostPosted: Tue Mar 31, 2009 7:09 am     Reply with quote

Hi
I am using a PIC 18f2620 working with a voltage of 5V.
I conected to the pic a bluetooth chip ( 3.3 V) using a usart connection .

To send commands from the PIC (master device) I put 2 resistors in order to reduce the voltage. It works and the bluetooth device can read perfectly the command from the PIC. On the other hand the answer from the bluetooth chip to the PIC goes through a wire without resistors. But the pic is not able to detect any answer....
I use the command kbhit to detect when an answer has arrived but it doesnt work. In my opinion is the level of the voltage that the pic is not able to detect....
am I right? it is posible to solve this problem changing the usart configuration? Thanks for your help
Ttelmah
Guest







PostPosted: Tue Mar 31, 2009 7:23 am     Reply with quote

Read the data sheet. The input 'threshold', for the UART pin, is 4v, when running off a 5v supply.

Where you go from there, depends on the data sheet for the Bluetooth module. Some 3.3v outputs, are '5v tolerant'. They will accept being pulled to a voltage _above_ the chip's supply. If the outputs on the Bluetooth unit, say they support this, then all you need do, is add a pull-up resistor, from this signal line to 5v. If not, then the circuitry gets more complex.

You can use a software 'UART', on another port, which will have a lower input threshold, if you select a pin that says 'DIG' in the data sheet, rather than 'ST'. However this then brings the perfromance limitations of a software UART. Not a good solution, if you want to do anything else while sending/receiving.

Several standard CMOS buffers have inputs that will accept the output of a 3.3v chip (look for chips with a 'high' threshold down in the order of 2v, for reliability), and give 5v out.

Best Wishes
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Tue Mar 31, 2009 7:58 am     Reply with quote

Another solution is to use 18LF2620 running at 3.3V

Cheers.
magestik



Joined: 16 Oct 2008
Posts: 59

View user's profile Send private message

PostPosted: Tue Mar 31, 2009 3:36 pm     Reply with quote

From PIC to module (5V to 3.3V) : Resistor bridge is ok
From module to PIC (3.3V to 5V) : There are several ways to enhance the level (diodes, logic gates, level shifters...)

Take a look here
angel



Joined: 19 Oct 2004
Posts: 40

View user's profile Send private message

thanks
PostPosted: Wed Apr 01, 2009 6:12 am     Reply with quote

thanks everybody
At the end I took one of the ideas of Ttelmah. I made a connection to a TTL pin and it works... I dont need to implement more hardware Smile
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