View previous topic :: View next topic |
Author |
Message |
angel
Joined: 19 Oct 2004 Posts: 40
|
5 V PIC conected to 3.3 chip (kbhit function...) |
Posted: Tue Mar 31, 2009 7:09 am |
|
|
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
|
|
Posted: Tue Mar 31, 2009 7:23 am |
|
|
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
|
|
Posted: Tue Mar 31, 2009 7:58 am |
|
|
Another solution is to use 18LF2620 running at 3.3V
Cheers. |
|
|
magestik
Joined: 16 Oct 2008 Posts: 59
|
|
Posted: Tue Mar 31, 2009 3:36 pm |
|
|
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
|
thanks |
Posted: Wed Apr 01, 2009 6:12 am |
|
|
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 |
|
|
|